Castlevania Lords of Shadow 2

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
HelenaAlucardian
Posts: 17
Joined: Fri Mar 06, 2020 9:23 pm

Re: Castlevania Lords of Shadow 2

Post by HelenaAlucardian »

Big Boss wrote: This would really be fantastic. I was using, the tool that LokiReborn made available here, but now it is giving me an error, this error: Exception of type 'System. OutOfMemoryException 'was thrown, I have no idea how to solve it.


Yes. It is exactly this error that is occurring for me, I have already researched a lot about it, some say that memory error, others on NET. Framework, and others in the tool's own compilation, but I've tried all the requests I found, but none worked, except modifying the tool, because I'm not a programmer, I can't do that, I don't know how to solve this problem.
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: Castlevania Lords of Shadow 2

Post by Shokoniraya »

I think it's a problem about temporary stuffs, make sure you have enough memory space (ram) and close programs, since this is a huge archive, programmer must do the operation on disk, not in ram!

this game using a huge archive, however, I think game can reads files from a mod folder (I think, not sure)
HelenaAlucardian
Posts: 17
Joined: Fri Mar 06, 2020 9:23 pm

Re: Castlevania Lords of Shadow 2

Post by HelenaAlucardian »

It would be very good, if a programmer who wants to help solve all these problems, managed to create a tool that created files.packed from these games, from scratch, and could even add more files within them, just like there are for other games, so we moders, we could create mods for these games in a less limited way ...
Big Boss
Posts: 27
Joined: Mon Feb 03, 2020 3:17 pm

Re: Castlevania Lords of Shadow 2

Post by Big Boss »

HelenaAlucardian wrote:It would be very good, if a programmer who wants to help solve all these problems, managed to create a tool that created files.packed from these games, from scratch, and could even add more files within them, just like there are for other games, so we moders, we could create mods for these games in a less limited way ...


Yes, I would also like to, because I am also trying to make the same mod as you, to unite the four Data00.packed, the four Data01.packed, the two English.packed, which counting the DLCs, this is the total number of files that would need become one, so that the game is all unified, there can also be several ways to do this, I just don’t know how ... I’ve tried in other forums, those specifically related to Lords of Shadow 1, but they all seem inactive, only this one seems to still work, so just like you, I hope for someone or a programmer to help us ...
DDust
Posts: 13
Joined: Fri Mar 13, 2020 2:45 pm

Re: Castlevania Lords of Shadow 2

Post by DDust »

yes guys, I’m trying to do the same thing, but without a tool, it’s complicated, information on the internet is very scarce, there isn’t even a tool to do this, nor is there anyone who can teach us how to proceed, the tool posted here, it was a hope, but it only refers to a single file, it seemed to work on others, but not really, I’ve already tested it, even so it refers to LOS 2, I believe that any programmer who wants to help us, can create a tool, for both games, and that works for any .PACKED file, I hope this topic will help us ...
DDust
Posts: 13
Joined: Fri Mar 13, 2020 2:45 pm

Re: Castlevania Lords of Shadow 2

Post by DDust »

For those who want to help, and give us a tool, here are all the original .PACKED of the two games and their dlcs, LOS1 and LOS2:
Link: https://drive.google.com/open?id=1XxbDP ... GXxyPx2Dlp
LokiReborn
Posts: 190
Joined: Fri Aug 26, 2016 3:11 pm

Re: Castlevania Lords of Shadow 2

Post by LokiReborn »

Honest you guys just need to change the Memory Stream to a File Stream, the thing is the only original example was an extremely small file so it's faster to do in Memory rather than Disk IO, when you add the requirement to work with 8+ GB of data that changes things.

Additionally the DLC content uses a block size 1/4 of that of the main archives which will impact game performance, so that value should be changed back to 0x4000 from 0x1000 (This is the issue BigBoss ran into reading the file)

It's not overly complicated stuff but the way the new archive is made would need to be changed as well unless you want to write a temporary file then read and copy it too and there are 2 steams being written to at once currently, one for the header and one for the data, so to really do a write to disk you'd need to do a pass to generate the header and then go through and write the data if you want it all directly written.

This topic has gone far beyond the scope of the original request though and generating entirely new archives and merging them, and without having the game guessing at some stuff (like the buffered bytes being half of the block size) etc. and using static values you guys really need a developer working on a specific version and testing.
HelenaAlucardian
Posts: 17
Joined: Fri Mar 06, 2020 9:23 pm

Re: Castlevania Lords of Shadow 2

Post by HelenaAlucardian »

LokiReborn wrote:Honest you guys just need to change the Memory Stream to a File Stream, the thing is the only original example was an extremely small file so it's faster to do in Memory rather than Disk IO, when you add the requirement to work with 8+ GB of data that changes things.

Additionally the DLC content uses a block size 1/4 of that of the main archives which will impact game performance, so that value should be changed back to 0x4000 from 0x1000 (This is the issue BigBoss ran into reading the file)

It's not overly complicated stuff but the way the new archive is made would need to be changed as well unless you want to write a temporary file then read and copy it too and there are 2 steams being written to at once currently, one for the header and one for the data, so to really do a write to disk you'd need to do a pass to generate the header and then go through and write the data if you want it all directly written.

This topic has gone far beyond the scope of the original request though and generating entirely new archives and merging them, and without having the game guessing at some stuff (like the buffered bytes being half of the block size) etc. and using static values you guys really need a developer working on a specific version and testing.


Hello, and how could I do this? to generate larger files? I don't know how to change this in the tool you created ...
DDust
Posts: 13
Joined: Fri Mar 13, 2020 2:45 pm

Re: Castlevania Lords of Shadow 2

Post by DDust »

Yes, and neither would I ... it would help if we could at least add a few more files, or at least recreate the two large files from the main game ...
of Lords of Shadow 1 of course ...
LokiReborn
Posts: 190
Joined: Fri Aug 26, 2016 3:11 pm

Re: Castlevania Lords of Shadow 2

Post by LokiReborn »

You guys can try this assuming it's using the same format that it was designed for, that has the changes to write to disk rather than memory etc. but if that doesn't work with a version of something then you'd need to do it as I have no way of testing this stuff.
Last edited by LokiReborn on Sat Mar 14, 2020 2:09 pm, edited 1 time in total.
DDust
Posts: 13
Joined: Fri Mar 13, 2020 2:45 pm

Re: Castlevania Lords of Shadow 2

Post by DDust »

LokiReborn wrote:You guys can try this assuming it's using the same format that it was designed for, that has the changes to write to disk rather than memory etc. but if that doesn't work with a version of something then you'd need to do it as I have no way of testing this stuff.



It doesn't work for Lords of Shadow 1, but for Lrds of Shadw 2 files, yes, wouldn't it be simple to modify it for a Lords f Shadow 1 file? in a Los 2 file, and it works in all of Los 2, got it? I think u just this change, it solves.
HelenaAlucardian
Posts: 17
Joined: Fri Mar 06, 2020 9:23 pm

Re: Castlevania Lords of Shadow 2

Post by HelenaAlucardian »

That's right, it only works on LOS2, I think that if it changed to the Data00.packed file on LOS1 it would work on the rest of the files, which is what happens with LOS2. please, we are so close to the solution, So give us a tool that recreates at least Data00.packed and English.packed, help us just a little more, please ...
DDust
Posts: 13
Joined: Fri Mar 13, 2020 2:45 pm

Re: Castlevania Lords of Shadow 2

Post by DDust »

Yes, look, you managed to make the tool recreate these two files: Data00.packed: https://drive.google.com/open?id=1wNc8N ... np3wRSWVvy English.packed: https://drive.google.com/open?id=13E3Kq ... VRm6EKyDWw , for me it is enough and I stop taking your time, I believe for Helena also from what I understand .. please brother, I worked very hard on the mods, and losing them will be very sad, I know you are busy , you don’t have time, smart people never have, but if you recreate these two, you’ll give us what we need.
LokiReborn
Posts: 190
Joined: Fri Aug 26, 2016 3:11 pm

Re: Castlevania Lords of Shadow 2

Post by LokiReborn »

This has support for both versions of LoS w/ a background worker & support for cancellation, mind you if you cancel packing an archive it won't fix the file count so it will damage the file.

Regardless you should should have what you need

Edit: see last post.
Last edited by LokiReborn on Mon Mar 23, 2020 4:35 am, edited 1 time in total.
HelenaAlucardian
Posts: 17
Joined: Fri Mar 06, 2020 9:23 pm

Re: Castlevania Lords of Shadow 2

Post by HelenaAlucardian »

LokiReborn wrote:This has support for both versions of LoS w/ a background worker & support for cancellation, mind you if you cancel packing an archive it won't fix the file count so it will damage the file.

Regardless you should should have what you need

This is really fantastic, if I saw you now, I would even kiss you, the tool worked perfectly, and even, it’s really cool too, visually speaking, much more dynamic, thank you very much for your help, I am grateful, from the heart, I feel a lot of affection for these two games, and being able to create mods for them, for the Castle community, which I participate in, is a pleasure, despite being laborious, thank you for your help, you really are a great developer, as well as a person who likes to help kiss ... ;)
DDust
Posts: 13
Joined: Fri Mar 13, 2020 2:45 pm

Re: Castlevania Lords of Shadow 2

Post by DDust »

Yes!!! It also worked for me, thank you so much, you really helped a lot, that the world, especially the world of moders, has more people like that, who share their knowledge and skills in public, you have no idea how many forums I went to ask for help , and some even said they could do it, but they didn’t want to, but you don’t, you went to the end, and helped us, my eternal gratitude friend.
HelenaAlucardian
Posts: 17
Joined: Fri Mar 06, 2020 9:23 pm

Re: Castlevania Lords of Shadow 2

Post by HelenaAlucardian »

It's a shame that it didn't work for Castlevania Los 2's Data00.packed, I didn't say anything before, not to bother you anymore, but it didn't work, it creates the file, but when the game runs an error, something like: Unhandled Error...
DDust
Posts: 13
Joined: Fri Mar 13, 2020 2:45 pm

Re: Castlevania Lords of Shadow 2

Post by DDust »

Well, it's true, with the LOS 1 files, everyone recreates perfectly, and works perfectly, but with LOS 2 files, they are not recreated, but they show this error when running the game, since Helena spoke, I decided to speak too , n wanted to bother you too, but if that were resolved, this tool would be perfect ...
LokiReborn
Posts: 190
Joined: Fri Aug 26, 2016 3:11 pm

Re: Castlevania Lords of Shadow 2

Post by LokiReborn »

I mean it was working with it before, the only thing that changed for Data 0 in LoS 2 is that fact that the block size was changed from 0x10000 to 0x40000, I can not use a static value and it can be read from the original file then I suppose, like I said before this is party guess work without the game because the structure itself is fine.
HelenaAlucardian
Posts: 17
Joined: Fri Mar 06, 2020 9:23 pm

Re: Castlevania Lords of Shadow 2

Post by HelenaAlucardian »

It worked, however, for English.packed and Music.packed did not ... it's a shame, because if it worked for them too, this tool would be definitive ...