News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: How can I modify files within PSX ISO for a hack of RE Director's Cut DualShock?  (Read 6062 times)

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1629
    • View Profile
Good day.
Lately I've been playing a hack of Resident Evil Director's Cut Dual Shock, called Resident Evil Ultimate Director's Cut Dual Shock, which can be found here:
https://nobelgas.blogspot.com/2019/02/resident-evil-ultimate-directors-cut.html

I did some runs of the game, and it's quite good the amount of stuff that is restored and uncensored for this hack. However, there's two things specifically that I'm not fond of to make this the ultimate way to experience the original Resident Evil Director's Cut on console:
  • The modified graphics for the Warning Screen, Logo, title screen, etc.
  • The new "Deranged" mode. Feels really weird and weirdly put together.

So, given those two things, I wanted to attempt removing those two things, and putting back all of the uncensored stuff into RE DC DS (movies, music, and keep Ultimate's Arranged costumes for Chris, Jill & Rebecca).

The list of modified files from the Ultimate hack are as follows:
Spoiler:
PROG2/
LOGO.EXE

DATA/
GWARNIN1.TIM
TITLE.PIX
TMOJI.TIM

Models for Chris, Jill & Rebecca:
ENEMY/
EM1032.EMD
EM1033.EMD
EM1035.EMD
EM1040.EMD
EM1041.EMD
EM1043.EMD
EM104C.EMD

Music and sound files:
All files after SEP00.HSB
SOUND/
SEP00.HSB -> SEP36.HSB

ZMOVIE/
CAPCOM.STR
DM3.STR
DM4.STR
DM6.STR
DMB.STR
DMC.STR
ED1.STR
ED2.STR
ED3.STR
ED4.STR
ED5.STR
ED6.STR
ED7.STR
PJ.STR
STFR.STR

And huge amount of files/rooms from the several "STAGEX" folders (most likely the Arranged mode rooms)

I tried modifying the Track 1 BIN file from Ultimate and the official one, putting all of the sounds, movies and 3D models from Ultimate into Dual Shock, but I couldn't find a way to make the modified Track 1 BIN work with any emulator.

So with that said, I wanted to ask how would I go about properly doing this?
I have already listed the modified files, and the only ones I'd like to port over from the Ultimate DCDS hack into normal DCDS are the new costumes for Jill, Chris and & Rebecca (inside the ENEMY folder), the new music (inside the SOUND folder), and the uncensored FMVs (inside the ZMOVIE folder).

If anyone has any suggestions or knows how to properly do this, please let me know!

niuus

  • Full Member
  • ***
  • Posts: 213
    • View Profile
Good day.
Lately I've been playing a hack of Resident Evil Director's Cut Dual Shock, called Resident Evil Ultimate Director's Cut Dual Shock, which can be found here:
https://nobelgas.blogspot.com/2019/02/resident-evil-ultimate-directors-cut.html

I did some runs of the game, and it's quite good the amount of stuff that is restored and uncensored for this hack. However, there's two things specifically that I'm not fond of to make this the ultimate way to experience the original Resident Evil Director's Cut on console:
  • The modified graphics for the Warning Screen, Logo, title screen, etc.
  • The new "Deranged" mode. Feels really weird and weirdly put together.

So, given those two things, I wanted to attempt removing those two things, and putting back all of the uncensored stuff into RE DC DS (movies, music, and keep Ultimate's Arranged costumes for Chris, Jill & Rebecca).

The list of modified files from the Ultimate hack are as follows:
Spoiler:
PROG2/
LOGO.EXE

DATA/
GWARNIN1.TIM
TITLE.PIX
TMOJI.TIM

Models for Chris, Jill & Rebecca:
ENEMY/
EM1032.EMD
EM1033.EMD
EM1035.EMD
EM1040.EMD
EM1041.EMD
EM1043.EMD
EM104C.EMD

Music and sound files:
All files after SEP00.HSB
SOUND/
SEP00.HSB -> SEP36.HSB

ZMOVIE/
CAPCOM.STR
DM3.STR
DM4.STR
DM6.STR
DMB.STR
DMC.STR
ED1.STR
ED2.STR
ED3.STR
ED4.STR
ED5.STR
ED6.STR
ED7.STR
PJ.STR
STFR.STR

And huge amount of files/rooms from the several "STAGEX" folders (most likely the Arranged mode rooms)

I tried modifying the Track 1 BIN file from Ultimate and the official one, putting all of the sounds, movies and 3D models from Ultimate into Dual Shock, but I couldn't find a way to make the modified Track 1 BIN work with any emulator.

So with that said, I wanted to ask how would I go about properly doing this?
I have already listed the modified files, and the only ones I'd like to port over from the Ultimate DCDS hack into normal DCDS are the new costumes for Jill, Chris and & Rebecca (inside the ENEMY folder), the new music (inside the SOUND folder), and the uncensored FMVs (inside the ZMOVIE folder).

If anyone has any suggestions or knows how to properly do this, please let me know!
Did you try rebuilding and reauthoring the ISO?

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1629
    • View Profile
Did you try rebuilding and reauthoring the ISO?

How can I do that?

Asaki

  • Full Member
  • ***
  • Posts: 203
    • View Profile
Did you try rebuilding and reauthoring the ISO?

Doesn't work, there's a copy protection (CRC check?) on the game that must be bypassed.
I tried adding the color intro video back into the game once-upon-a-time, but gave up when I was told about it.
Obviously someone somewhere knows how to bypass it ;) Just not me.

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1629
    • View Profile
Doesn't work, there's a copy protection (CRC check?) on the game that must be bypassed.
I tried adding the color intro video back into the game once-upon-a-time, but gave up when I was told about it.
Obviously someone somewhere knows how to bypass it ;) Just not me.

So it's due to a CRC thing then?
I wish there were some clearer instructions on how to actually build a working PSX ISO/BIN, or make it work after changing stuff in it.

I mean, I even managed to open the 3D models of the game and the logos, but fixing the BIN to boot on an emulator is where I bumped ito a wall lol

I already have everything ready for testing, all the files I want imported and all, but booting the modified BIN is as far as I get.
Any kind of help will be greatly appreciated.

PhOeNiX

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
The CRC thing is not a general PSX image issue. It is specific to this game. If you first don't remove this CRC check, any modification you apply to the game data will result in a black screen.

February 25, 2021, 04:35:24 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
This is where the game checks for the CRC in the french version of the game:
« Last Edit: February 25, 2021, 04:35:24 pm by PhOeNiX »

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1629
    • View Profile
The CRC thing is not a general PSX image issue. It is specific to this game. If you first don't remove this CRC check, any modification you apply to the game data will result in a black screen.

February 25, 2021, 04:35:24 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
This is where the game checks for the CRC in the french version of the game:


Oh that's a great starting place!
Do you happen to have the Hex bytes that represent that BNE and/or the location?

PhOeNiX

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
In the main EXE (the SLUS) of the USA version of RE DC you should see the sequence
Code: [Select]
0300A614

at address 0x5534. That sequence is your bne, just nop it with 00000000.

There is one more place where the game checks for a CRC, but it seems the game works already with the change I suggested.
In case you need to also change this additional check, in the SLUS of the USA version of RE DC, you should see the sequence
Code: [Select]
F5FF4010at address 0x8100. Replace also this with 00000000.
« Last Edit: February 26, 2021, 03:14:49 am by PhOeNiX »

dukemagus

  • Newbie
  • *
  • Posts: 2
    • View Profile
The resident evil modding community is currently a mess: old forums with a lot of info are either gone or abandoned and full of broken links and images

But if you want to play around with resident evil, check this link for some basic information on how to deal with the files.


ShadowOne333

  • Hero Member
  • *****
  • Posts: 1629
    • View Profile
In the main EXE (the SLUS) of the USA version of RE DC you should see the sequence
Code: [Select]
0300A614

at address 0x5534. That sequence is your bne, just nop it with 00000000.

There is one more place where the game checks for a CRC, but it seems the game works already with the change I suggested.
In case you need to also change this additional check, in the SLUS of the USA version of RE DC, you should see the sequence
Code: [Select]
F5FF4010at address 0x8100. Replace also this with 00000000.

Found both addresses, and NOP'd both of them with 00 00 00 00
However, it seems the modified .BIN still refuses to boot properly once I put the modified assets into it.
Am I still missing something else?
Are the files inside the BIN also CRC verified perhaps?

PhOeNiX

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Then there is something wrong with your modified data. I would insert the new data incrementally, to see what works and what not.

niuus

  • Full Member
  • ***
  • Posts: 213
    • View Profile
Doesn't work, there's a copy protection (CRC check?) on the game that must be bypassed.
I tried adding the color intro video back into the game once-upon-a-time, but gave up when I was told about it.
Obviously someone somewhere knows how to bypass it ;) Just not me.
That's curious. Not even when i erased the videos in FF9 was a title that much protective.  :banghead:

PhOeNiX

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Then there is something wrong with your modified data. I would insert the new data incrementally, to see what works and what not.

What are you using to replace the files, btw?

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1629
    • View Profile
What are you using to replace the files, btw?
Right now I'm using PowerISO to replace the files.
Do you recommend another software to do so?

I tried replacing only the modified SLUS executable with the changed bytes, and even with just that file it fails to boot, so I must be doing it wrong.



EDIT #1:
I think I found a way to import them properly.
Just imported the modified SLUS with this new method, and it boots.
Now I'm importing all the modified files manually (one by one).
Once that's done, I'll test and let you guys know how it went...



EDIT #2:
Failure.
While the ISO does boot now into the WARNING screen, whenever I try to import any other file aside from the SLUS one, the game just stays at a black screen when the CAPCOM movie is supposed to play.
Doesn't matter if I just import one of the new Chris models, and leave everything else untouched, it always crashes right after the warning screen.

I'm using PSX-MODE2-EN, for reference:
https://www.romhacking.net/utilities/1417/
« Last Edit: February 27, 2021, 01:43:37 pm by ShadowOne333 »

acediez

  • Hero Member
  • *****
  • Posts: 502
    • View Profile
I've used "mkpsxiso" by LameGuy64 to rebuild PS1 discs from scratch on several projects (Mega Man 8/X4/X5, and now a Ganbare Goemon game)
https://www.romhacking.net/utilities/1573/

Edit: I just found out after writing this post that LameGuy64 recently released an "isodumper"
http://www.romhacking.net/utilities/1574/
This should make creating a base set of files and working mkpsxiso XML a lot easier, and will probably be a quicker to extract STR/XA files correctly.

mkpsxiso works pretty much out of the box, as long as you...
- Use the right licence file (I use the ones provided in the PSYQ SDK)
- You list the disc files in the XML in the right order by LBA (you can check the order on IsoBuster)
- ... and if the game doesn't use a custom table of contents format (like Mega Man 8/X4 do) or custom file checksums (like the Goemon games I'm currently working on do).

If you did everything right up to this point and the game still doesn't boot, it's probably because of one of those issues, in which case you'll need to debug and figure out what it is. If it's a table of contents, you'll just have to find it and understand it so you can update it with your file changes (sizes, addresses). If it's a file checksum integrity check, you'll have to either skip it (probably not a good idea if you plan to make it work on actual hardware and fragile CDs?), or reverse engineer it so you can update them as well.

Out of 6 PS1 games I've worked on, only Mega Man X5/X6 didn't have either... but they DID have a custom file pack format that did involve a custom table of contents anyway.

This is why I don't think we'll ever have a comprehensive PS1 disc building guide for romhacking. There certainly are for homebrew, but when it comes to romhacking, there's many different game-specific hurdles to take care of. I've been learning how to do it by pure trial and error. That said, I have made several threads along the way, and I always make sure I come back and edit my post with the solution in case someone else finds it useful. I'm gonna list them here, as well as other useful threads I've found.

General:
Tools I use #1: https://www.romhacking.net/forum/index.php?topic=26202
Tools I use #2: http://www.romhacking.net/forum/index.php?topic=26255.0 (MM8/X4 Undub thread, at the bottom of my first post)
ECC/EDC Checksum: https://www.romhacking.net/forum/index.php?topic=26257
Mode2 File (STR/XA) Extraction: http://www.romhacking.net/forum/index.php?topic=21811.msg304778 (LameGuy64's isodumper exists now, so I'd try that first)

Game-specific:
Custom disc table of content example (Mega Man X4): https://web.archive.org/web/20180819002900/http://romxhack.esforos.com/viewtopic.php?f=4&t=816 (Spanish)
Custom packed file format example (Mega Man X4, ARC files): https://www.romhacking.net/forum/index.php?topic=21714.msg303268
Handling DA Audio Tracks (Mega Man 8 ): https://www.romhacking.net/forum/index.php?topic=26343
Handling Mode2/Form2 Data Files (Goemon Ooedo Daikaiten/Shin Sedai Shuumei): https://www.romhacking.net/forum/index.php?topic=31247
Custom file checksum example (Goemon Ooedo Daikaiten/Shin Sedai Shuumei): https://www.romhacking.net/forum/index.php?topic=31325

February 27, 2021, 02:58:15 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
EDIT #2:
Failure.
While the ISO does boot now into the WARNING screen, whenever I try to import any other file aside from the SLUS one, the game just stays at a black screen when the CAPCOM movie is supposed to play.
Doesn't matter if I just import one of the new Chris models, and leave everything else untouched, it always crashes right after the warning screen.

Sounds to me like there's a custom tile of contents. By loading that other file, you're probably shifting the file start location of everything else that comes after (check the disc contents on IsoBuster and arrange them by LBA order to see what I mean).

Time to debug and find that table  :laugh: ☕☕☕
Try searching for the original LBA values on the game executable, but as little endian.
Example: LBA 13.975 (decimal) -> 00003697 (hexadecimal big endian) -> 97360000 (hexadecimal little endian)
You may be lucky enough to find it this way...
But more often than that, I've had to locate the file loading subroutine in-game and work from there.

By the way, isn't Resident Evil like one of the most modded PS1 series ever? You sure all of this isn't documented somewhere already?
« Last Edit: February 28, 2021, 05:14:18 pm by acediez »

PhOeNiX

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
I was assuming the modified files were imported with cdmage and that they were of the same size of the originals. If you import larger files, and change the lba's of the files in the bin, this is likely to break the game, if it uses a custom lbs/size table to locate files from the disc (which this game actually does).
Some games use the standard SDK cdSearchFile function to locate files by name, and thus do not care at which specific offset they are on disc. Some other games, for efficiency reasons ignore completely this, and compile a custom list of addresses, that of not changed to the new ones will of course break the game.

Btw, if you are going to use isodump by lameguy (the latest version uploaded here on rhdn, then you should use the latest mkpsxiso version also here on rhdn. Lameguy's GitHub has still old binaries of mkpsxiso that are not compatible with the latest version of isodump uploaded here at rhdn. (These tools have some changes I made and pull requested that fixed some serious bugs. Lameguy merged the changes but did not release new binaries yet).
« Last Edit: February 28, 2021, 02:30:27 am by PhOeNiX »

acediez

  • Hero Member
  • *****
  • Posts: 502
    • View Profile
Lameguy's GitHub has still old binaries of mkpsxiso that are not compatible with the latest version of isodump uploaded here at rhdn. (These tools have some changes I made and pull requested that fixed some serious bugs. Lameguy merged the changes but did not release new binaries yet).
Nice, thanks for your work, and for the heads up! I haven't had any issues since I updated to 1.23, and only ever checked the releases page on GitHub. I didn't realize there were newer versions here.

vivify93

  • Submission Reviewer
  • Hero Member
  • *****
  • Posts: 1169
  • Guardian of Mystery
    • View Profile
pardon me.

this is my favorite way to play re1 original (not counting remake) so i've taken notes on ultimate director's cut. the game is almost perfect except for a couple of issues

1. There is one small bug that was never fixed: on Jill’s route, if you get poisoned by the Yawn, a cutscene triggers of her waking up in the infirmary save room. Should this happen, a small room with candles you have to use the Lighter on will instead warp you inside the Garden’s shed without needing to collect any Crests. As the candle room doesn’t have any plot significant items, it can be safely ignored if the Yawn poisons Jill. This is a direct result of Deranged Mode's inclusion; this room takes you to the Garden in Deranged. Triggering the cutscene of Jill being carried to the infirmary seems to trigger the Deranged exception for this one room and this one room alone on any version.

2. there's an issue with the opening. instead of chris narrating, "there are only 3 stars members left now: captain wesker, jill, and myself. we don't know where barry is," it cuts off after he says "left now" and the audio seems to glitch out. imo this is less of an issue because it makes it fit better with both the chris and jill campaigns.


i admit i haven't read the thread thoroughly yet, but if any progress at all was made on this i thought it would be prudent to point out these issues.
All my life I've tried to fight what history has given me.

PhOeNiX

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Nice, thanks for your work, and for the heads up! I haven't had any issues since I updated to 1.23, and only ever checked the releases page on GitHub. I didn't realize there were newer versions here.
Thanks! Among the changes, I let isodump also dump the license from the game bin, so there is no need to look for an illegal SDK copy online. The extracted data is self-contained to recreate the game bin with mkpsxiso.

ShadowOne333

  • Hero Member
  • *****
  • Posts: 1629
    • View Profile
Thank you acediez and Phoenix for your feedback!

It seems like what acediez mentioned is what's happening with RE1.
I tried using isodump/mkpsxiso today, rebuilding the BIN by restoring the files from the Ultimate DS hack, but I get the same result. A black screen right after the "Warning" image.

So, according to what acediez mentioned, it might be that the game could be using a custom table of contents, or file checksums.

I downloaded IsoBuster, and looked at the LBA starting offsets of some of the files, and then did a search in the SLUS file. For example, I looked at the CAPCOM.STR file's starting LBA, which is 141,652.
Converted it to Hex, 0x022954, and then changed endianess of it, ending with 54 29 02
I got a match inside the SLUS_007.47 file at 0x089450, which [54 29 02 FF].
I tracked down the whole table, and I think the beginning of it is at location 0x087650 within the SLUS file.
I am still not sure what the 4th byte of each entry in the table seems to be, as it tends to change between files a lot.



That's progress for sure, but I am still not sure how I can go about manually modifying the whole table itself AFTER the BIN has been created. Doing it manually might be somewhat painful, as the very first modified file is within the ENEMY folder, and that would most likely shift the entire files afterwards. Do you know how can such process of modifying the table be made easier to deal with, acediez?

I assume that I'd need to create a dummy BIN first with all the files in place, so I can grab the LBA final offsets, then modify the SLUS, and then recompile the BIN to create the final one. Am I correct?



Aside from that, user SCD brought to my attention that another user, @SeiyaKOu, managed to restore the bloody message on the wall. Seems to be Room 207, but I am not sure if it's either the standalone ROOM207.BSS file, or if also the two ROOM2070.RDT & ROOM2071.RDT files as well (or one and not the other):
https://www.youtube.com/watch?v=HCA7RbnOkRY