PDA

View Full Version : KiriKiri and patch.xp3


qazmlpok
2009-02-17, 12:31
I'm trying to work with the scripts for a doujin game using KiriKiri. I got the Insani XP3 tools and modified them to handle the encryption, but I can't make the game load patch.xp3. I tried taking one of the script files and throwing in some English text and used the repack script to create patch.xp3 and put that in the same directory as data.xp3. No change. The (modified) extract script works on patch.xp3, so the archive was created correctly with the encryption set properly. patch.xp3 was created with a flat directory structure like the instructions said, but I also tried keeping the original structure with no luck. And yet when I completely rebuilt data.xp3 with the modified script file, it worked perfectly. So I didn't do anything strange to the script file, or modify the wrong file, or anything like that. It just doesn't seem to load patch.xp3 at all.

I can't seem to find any real English support for KiriKiri or the use of patch.xp3. All I'm going on is the README.txt in the Insani tools, which just says "It should work, unless it doesn't, but it probably will". It does mention that KiriKiri only "usually" looks for patch.xp3. So is there any way to definitely tell if it's not even looking for patch.xp3, and if not, make it read the patch? Or am I just doing something wrong here that's immediately obvious to more a seasoned hacker?

Enerccio
2009-02-18, 03:29
Why are you packing with insani tools?
Why not pack with kirikiri tools?

qazmlpok
2009-02-18, 18:05
Why are you packing with insani tools?
Why not pack with kirikiri tools?
Because I wasn't aware that was an option. I knew about the Insani tools, so I decided to use them. Would using the official tools even fix my problem? Plus, as far as I can tell, the Insani tools are the only ones in English.

Asceai
2009-02-18, 18:23
startup.tjs is generally the piece that ends up loading the patches. You'll have to check your game's startup.tjs to find out what patch files it uses + the loading order. While kirikiri is BY DEFAULT happy with patch.xp3, patch2.xp3 etc. the individual game may have modified this, to e.g. change the filenames of patches (like g sen does) or eliminate patch loading entirely (which means you'll have to do a little bit more work!). It's rare for the latter to happen because it means that the creator can't easily patch their own game, but it's not unheard of.

qazmlpok
2009-02-18, 20:27
useArchiveIfExists("patch.xp3");

that's in Initialize.tjs, which startup.tjs redirected me to. Comparing the file to Fate's Initialize.tjs shows no major changes. Both have the same useArchiveIfExists function and the exact same calls, using the exact same filenames. So, as far as I can tell from that, it should be loading patch.xp3. Only way I can see it being different from Fate is if Storages.isExistentStorage was redefined, but a function like that doesn't look like it could be redefined.

Maybe I'm packing the patch file wrong? Could you confirm the steps of,
modify file \out\scenario\scean\sc.ks, where '\out' is the target directory for the extract
move file to a new directory, \in. No directory structure within \in, no other files since none were modified
use the repack tool on \in to generate file patch.xp3
move patch.xp3 to the directory the executable is in.

Enerccio
2009-02-18, 22:05
that should work, hmm
if you use krkr repack tool, dont forget to actually move ks to the middle column so it gets packed.

Enerccio
2009-02-18, 22:15
Okay follow these steps:

1. run kirikiri/tools/krkrrel.exe
2. in the open directory, pick directory where are scripts you modified are located (it shouldn't have any subdirectories)
3. Click here:
http://i43.tinypic.com/1078fhf.png
4. Pick a place and filename for xp3.
5. Click on File (here):
http://i44.tinypic.com/23w8rcm.png
6. Click on this arrow:
http://i42.tinypic.com/2jcha9u.png
7. Go back and click here
http://i43.tinypic.com/23tl152.png

All done, just move your xp3 where you need to.

qazmlpok
2009-02-19, 06:10
Okay follow these steps:

1. run kirikiri/tools/krkrrel.exe
2. in the open directory, pick directory where are scripts you modified are located (it shouldn't have any subdirectories)
3. Click here:
http://i43.tinypic.com/1078fhf.png
4. Pick a place and filename for xp3.
5. Click on File (here):
http://i44.tinypic.com/23w8rcm.png
6. Click on this arrow:
http://i42.tinypic.com/2jcha9u.png
7. Go back and click here
http://i43.tinypic.com/23tl152.png

All done, just move your xp3 where you need to.

Thanks for the guide, but still no luck. Still no change in the script whatsoever.

I wonder, is it possible (and feasible) to add a few debug lines to the startup script? I saw some things that look like debug messages, but I've never seen any output. Is it possible to turn debug messages on so I could try some of my own?

Enerccio
2009-02-19, 23:58
You probably can run debug console but that I dunno how, sorry.

Lacan
2009-03-20, 12:58
qazmlpok, just out of curiosity, how did you modify insani tools for encryption anyways? I'm having trouble repacking .xp3 with encryption.

qazmlpok
2009-03-27, 05:24
qazmlpok, just out of curiosity, how did you modify insani tools for encryption anyways? I'm having trouble repacking .xp3 with encryption.

I extracted the files without decrypting them and opened some audio files in a hex editor. The first four bytes of a .ogg file are OggS, so I could compare the encrypted and unencrypted versions of those 4 bytes to get the XOR key. I was lucky, since the encryption was just a single byte XOR over the entire file.

If you meant how did I actually modify the tools, you'll need to learn a little bit of programming. The tools are written in Python, but if you know any language you should be able to manage. Look at the function 'decrypt' in xp3-extract and 'encrypt' in xp3-repack. Just follow what's already there to apply the encryption.

Starchanchan
2009-05-14, 19:20
qazmlpok—did you ever get this working? And if so, would you be willing to share the modified tools? Because I'm having the same problem; the built patch.xp3 doesn't seem to load, but when I rebuild the entire data.xp3, it works fine.

Unregistered
2009-06-10, 08:11
Is there a way to get this working with encryption? I've got it working, but FSN doens't like the patch.

Trying to insert changed images.

Unregistered
2010-05-29, 22:04
I want to ask something, when I try to extract a video from the xp3 file of [AXL] Kashimashi Communication with crass, I have a warning like this:
est_ed1.mpg: crc error (0x1aa6197d), should be 0xcc44a38a.

I try to xor that two hex string and give me 0xd6e2baf7, my question:are this string is a xor key for the xp3 file?
If this is not the xor key, please give me a hint to find them, I completely newbie at this...
Thank You.

Unregistered
2010-05-31, 11:08
Just a reminder to everyone: be aware that the encryption isn't be always a single xor key encryption. So unless you know exactly how the encryption works, making guesses won't get you anywhere.