PDA

View Full Version : Help, minori's .paz format..


blauerbrief
2006-12-05, 07:49
I got ef~a fairy..~ trail version.
I success unpack ef data from .paz files with this tool (http://atelibet.s11.xrea.com/side_yuu/)
but I don't know that how can repack .paz format..
haven't anyone repacker program or ideas?
sorry for my poor english.

roxfan
2006-12-05, 13:14
Try this.
It's best to use a list file for packing back, e.g.:

mkdir scr
cd scr
..\paz e ..\scr.paz
dir * /b >..\list.txt
..\paz a ..\scr1.paz @..\list.txt

blauerbrief
2006-12-05, 19:36
thank you roxfan!
unpack and repack perfect.
but one more question.
I edited script file and repack..
but It can't display english&korean letter.
is ef using own fonts?
or windows fonts?
How can I fix for display Korean Letter or ef using korean fonts..?
my friends try to fix it, but looks failed.

http://kr.img.dc.yahoo.com/b9/data/rubbish/efkor007.jpg

- runs with original exe files.

http://kr.img.dc.yahoo.com/b9/data/rubbish/efkor008.jpg

- runs with temp-hexed exe files. Can't see fonts.

edit : english is shown well, but Korean letter never show up..

devilforgemaster
2006-12-05, 23:33
You need to edit the exe file because minori doesn't use unicode..

What's the format for the list file?
I tried to make a list.txt like that
C:\100_01.sc
C:\movie.sc
C:\opening.sc
C:\test.sc

and used this command, but it doesn't work..
paz a ..\scr.paz @c:\list.txt

EDIT:I didn't see the pictures..They look good to me.
Have you tried clicking on the little triangles beside the font preview?
Maybe it's due to the font doesn't have Korean characters or you need to edit one or two bytes in the exe file to make it use something like EUC-KR instead of Shift-js.
I think ef only lets you choose the fonts that can display Japanses characters. I don't know how to change it..maybe do something on the font file?

By the way..I've asked someone for the first fan disk key. Here it is.

blauerbrief
2006-12-06, 00:28
How can I fix it?
someone told me "it's relation with Japanese Halfwidth and Fullwidth Forms check problem.. so I can solve it."
but he doesn't told solution to me because it's secret -_-

http://kr.img.dc.yahoo.com/b9/data/rubbish/SW.jpg

- this 'solved' ef setting screen shot, Korean Fonts works good. but I don't know how to it.

roxfan
2006-12-06, 10:43
devilforgemaster
Just a list of filenames. You don't need full paths as long as they all reside in the current directory. If you use the commands I provided, dir/b should generate a proper list.
As for Korean text, you will probably need to patch in the exe:
1) lfCharset parameter to the CreateFontA call. Japanese is 128(0x80), Korean is 129(0x81)
2) Checks for lead bytes. Shift-JIS (CP932) has two ranges of lead bytes: 0x81-0x9F and 0xE0-0xFC, while Korean (CP949) only has one range - 0x81-0xFE. For example, in a code like this:

cmp eax, 81h
jb short loc_439933
cmp eax, 9Fh
jbe short loc_439927
cmp eax, 0E0h
jb short loc_439933
cmp eax, 0FCh
ja short loc_439933

Just patch the second jump to execute always:

cmp eax, 81h
jb short loc_439933
cmp eax, 9Fh
jmp short loc_439927

devilforgemaster
2006-12-06, 11:51
Hehe, it's working. Thanks roxfan.

blauerbrief
2006-12-06, 19:19
thank you for answering roxfan.
I try it. but I failed.. can you fix it?
http://blogfile.paran.com/BLOG_506508/200612/1165385101_ef_trail_kr_test_2.rar
CreateFontA call was already solved.
but second step failed..

p.s : have anyone Haru no Ashioto key? roxfan's tool doesn't work with ef keys.

roxfan
2006-12-07, 12:44
Use these for Haruoto:

[scr]
Key1=6AE90C8FCF059136FCD7D50292E7EBAA9D8595D74B93E1566E1080FCB163E957
Key2=9D6C311A494AA644E3EC3115E35A68B108BF7591193DA9AC5C6FDE69D5BD9042
[bg]
Key1=3E63B937C93F6FF9975C3FD2F74147555EF915C929E241551335CBEB775834F5
Key2=46E65EC1C77A24AC103EB8104636BFED964B2C59F219DFA88B79FD5B12CC0DC9
[st]
Key1=AD0DD78EBA94FBB545A952A749CF07D2AACD7419ED7CBDFEBC522E901CB15415
Key2=6BEFDC761B252E6D2FB7C77078A65A5B8F97A5E092A113AE9DDA15620E9F4031
[sys]
Key1=77A6255261C5F32BC67ECE424B51EDE140C175865822171127276AAA5F2E0876
Key2=CA496BF9050B844801181FF63A6AF9BBB3629DE4B895027D5253E54089F6E63B
[bgm]
Key1=5BF064437F91181BD99B7363BC87B741E194D6D12A930D4D16743FFB028F12D9
Key2=24B2CA0947EEE8FD4620816249415ECCC26DD72625B46FD76AA32FB34291C2A7
[voice]
Key1=1BA95423D4BA2A453FC000CA5B3026B44D0758BA2291607346F86D41C29330FE
Key2=38EBBA679F8C184BBE91AA7368EC47507B78126699C0187AA48CB17CFA2F9335
[se]
Key1=7591B5B020FEE968B8AC3736E90DF9F844DABB0102DAD0437A75B33D62FB23A4
Key2=C8B4FBD3CEA6D5F428295DEA552B75059F430D63D477BE26C1CC2C5B719118A4
[se]
Key1=7591B5B020FEE968B8AC3736E90DF9F844DABB0102DAD0437A75B33D62FB23A4
Key2=C8B4FBD3CEA6D5F428295DEA552B75059F430D63D477BE26C1CC2C5B719118A4
[mov]
Key1=2A6A46AB221E14450420D66826DEF2CE86CCBF65882F1C7C70A9D2AEA187AA8C
Key2=C8B4FBD3CEA6D5F428295DEA552B75059F430D63D477BE26C1CC2C5B719118A4

blauerbrief
2006-12-07, 19:16
ok. roxfan. I have some question.

first, I find 'CreateFontA' function but I can't found charset = 128
http://kr.img.dc.yahoo.com/b9/data/rubbish/efkorq1.jpg

then edit here.
http://kr.img.dc.yahoo.com/b9/data/rubbish/efkorq2.jpg

finally, I find cmp eax,81h... edit. all go to 00414701
http://kr.img.dc.yahoo.com/b9/data/rubbish/efkorq3.jpg

http://kr.img.dc.yahoo.com/b9/data/rubbish/efkor009.jpg

but I still can't see Korean Font. (maybe eftrail.exe only read support japanese fonts..)
How can I edit it?

sorry for newbie's annoying questions.

kyun
2006-12-08, 01:17
first, I find 'CreateFontA' function but I can't found charset = 128
http://kr.img.dc.yahoo.com/b9/data/rubbish/efkorq1.jpg
You have to set a break at 0x004714AE.
http://img180.imageshack.us/img180/6840/1li2.png

http://kr.img.dc.yahoo.com/b9/data/rubbish/efkorq3.jpg
You're in the wrong area. If you put a break on it and run the program, nothing goes to that part so that part is useless. The one you should be editing is 0x00435735.

http://img180.imageshack.us/img180/2047/2ah2.png
And there we go.

So to tell you exactly what to do:
0043573D JBE 004357CF

004713AA MOV DWORD PTR SS:[EBP+2C],80
0043573D JMP 004357CF

004713AA MOV DWORD PTR SS:[EBP+2C],81

Vlobulle
2006-12-08, 02:40
Thank you, roxfan and kyun : I got the trial to show my lame french translation :)

blauerbrief
2006-12-08, 07:51
Very thank you kyun!!!! I finally got it. I never forget it.

http://kr.img.dc.yahoo.com/b9/data/rubbish/efkor010.jpg

Korean works correctly.

http://kr.img.dc.yahoo.com/b9/data/rubbish/efkor012.jpg

Korean Font working (only gulimche. others not works. why?)

http://kr.img.dc.yahoo.com/b9/data/rubbish/efkor011.jpg

Korean test.

hm... one more question.
I edited script files. but every letters looks like correctly.
but they ignore every space( ). can I fix it?

kyun
2006-12-08, 16:21
It looks like it is trying to display japanese with the korean fonts enabled, which it doesn't like. Mine will do the same thing if I type in japanese when it expects korean.

I have no idea about the space thing. It's something in the engine and not related to the hack. I tried both the original and the hacked one and neither of them work with spaces. Sorry. :(

blauerbrief
2006-12-08, 21:12
http://kr.img.dc.yahoo.com/b12/data/lovegame/efkor013.jpg
http://kr.img.dc.yahoo.com/b12/data/lovegame/efkor014.jpg

ok. I solve font problem. it's simple.
but I have more problem..
first, Korean mode. Character mouth doesn't animaited.
second, Space Problem. ( ) this space work correctly. but ( ) this space work incorrectly. (if ( ) space in sentence , sentence won't display)
third, I don't know that Character name , Character speech control code.
so 'Character name' ugly words display.

http://kr.img.dc.yahoo.com/b9/data/rubbish/efkor011.jpg

ugly.

kyun
2006-12-09, 02:00
For the name thing, edit 0x000E855C in a edit editor. It's the japanese ???s that display when a character's name has a @ in front of it. 0x000E8554 is 】 and 0x000E8558 is 【. You'll want to edit all of those to work with the korean translation.

Do you think you could upload what you have done of the translation so far (or at least up until parts where there are speaking) so I could see what kind of changes you made? The character's mouths move when I'm using the original script so I think it's something you might've done.

Vlobulle
2006-12-09, 07:32
For the space problem, I used umbreakable spaces ( ) (xA0 in the ansi-1252 charset), which are correctly displayed (but I don't know if there is the same kind of space in the charset you are using).

And I simply deleted all the control caracters, until I get something better to work. (and added a simple hack to remplace one specific caracter with a line break, thus I can make something not to ugly)

And for now I don't seem to have any voice problem.

http://pollo.free.fr/plop/ef/trial/ef1.jpg

blauerbrief
2006-12-09, 08:42
for kyun
http://thehighwind.net/temp/efscript.rar

This is edited script and original script.
and Korean Edited Exefile..

Kyun, thank you for supporting me.

hmm..
Would you join our Minori's game Korean Localizing project?
your support is great help.

for Vlobulle

your advice is thanks. but, A0 is not space in Korean.
and not voice problem. Character Mouth Animation Problem.

Vlobulle
2006-12-09, 10:13
I just tried : the game can perfectly show normal spaces, the trick is to replace some useless character with the space just before it's drawn (and after it has been read, because usual space seems to be used as a control char by the script).

For exemple, let's say that x2A is an useless one-byte char in your charset (in fact it's a *, since I don't know the Korean charset at all, but I'm sure there are some other).

At 0043573D, simply insert something like:
if ESI == 2A, then ESI = 20

(of course there is the little problem of writing the if statement at the right position, I used a call to the end of the file, where there are plenty of zeros)

Thus, each time the game will read a x2A, it will display a space.

It's ugly (I'm not used to meddle with debugging), it requires to make a tool to convert an human-written script into a game-parsable one, but at least, it works (I use it for the space and the line break).

By the way, sorry, I was also speaking of the mouth animation.

kyun
2006-12-09, 11:01
Would you join our Minori's game Korean Localizing project?
your support is great help.
Sure, I'm willing to join. What's the most convenient way to communicate for you?

About the mouths, you have to be really careful about editing. I can do that part if you want. Here's the new EXE with the 【???】 fix and the new 100_01.sc.
http://www.sendspace.com/file/0gt481

blauerbrief
2006-12-09, 11:36
[] Problem was solved. it's working. thank you.
but program with Korean text, Mouth animation still won't working....
and we have ( ) space problem.
hmph. it's not important, but ( )space for perfect Korean sentence..
( ) space is ugly.

Thank you for joining minori project.
If you need contact me, send email to blauerbrief_at_gmaildotcom (sorry. goddamnspam)
or MSN - blauerbrief_at_hotmaildotcom

kyun
2006-12-09, 11:55
I added you to my list but it looks like it added you to both of my accounts for some reason (I'm not sure if it sent an add from both, but it added you to both lists). Just ignore the other one if you received more than one. I'll talk to you some more about it on MSN.

blauerbrief
2006-12-10, 06:29
I finally finish ef trial version Korean Localization.
Thank you, Nagato(kyun), Vlobulle, roxfan.

Unregistered
2006-12-11, 08:15
What is this (http://kr.img.dc.yahoo.com/b9/data/rubbish/efkorq1.jpg) program you are using? Does it let you edit in that view, too?

I'm still stuck in the dark ages, editing things manually in a hex editor... something a little easier to use without separate dis/re-assembly would be nice.

kyun
2006-12-11, 10:09
The program is called ollydbg (http://www.ollydbg.de/). Yes, you can edit in that view as well. It's a very useful program for ASM editing.

kyun
2006-12-22, 18:27
roxfan, is there any chance you'll be updating your paz tools for the full version of ef? They changed the paz format a bit. From what I could tell (I'm not sure how to decrypt blowfish stuff so I couldn't really do much), the first 4 bytes aren't there anymore and it goes right into the data. I already did the keys for it if it helps any:

[scr]
Key1=ECA15A7AD0797AFF06D430CFB80480373E861EB27C08441457420BC82B0CF4C7
Key2=2A96DAE6CFB3D59C77578EE39E03E42A49382FDD1283BA7A668A03F3ABCA8EA7
[bg]
Key1=15EDC3CAC77B6DD638F51A91503D94853985BE561EA0F01BA31D7892D10DB6BD
Key2=D636FD61EADD221136D010946785F7845AD65F5FFDC5A1D2727BBC6A81F653D5
[st]
Key1=908072D3072E3DB95CC899C812B558A3C88EB2FF5AC78C629865FA84D40A9EFA
Key2=BC256924433F7B2382263D9C7B5CD7355FC626C366F64814376C6CF8EA733693
[sys]
Key1=13295549BB673517D3434F47EE5E64144E038A121FED0EBF626D96F7CED9F030
Key2=6CAA903D57255799EB65C5CFB1B9E2277AF13093BDEFE979AF5DAC91BED05315
[bgm]
Key1=F669D5A10E21CCA01863C3B343DFCF0FE31427C6557B9FD478EB3C5B1F9F6DB6
Key2=6B99AD59CFB0ED3D3D83E108D78ED33CA2220E01237100598B83CF776B9745CE
[voice]
Key1=22BF45D9430AEF7DBA3D955D42AF39900BC24C8C720D0881085A3064C70B8F8D
Key2=A13BBA883AA3DD0C3092A8ADFE258014CD5B0D579D8A219CED2DB8D682320D3A
[se]
Key1=739EB8FD201A9CFC1B2D4483153C066579888CCD7526B3E59C35608598149053
Key2=CC17292610A9201817B8DDF0D262CD4453CE389881B6B4313F081CA0AAF3866E
[mov]
Key1=75E3E540C95B7717344AD9C712E35ABB31608DDB0457FDC295C40A7A14B5C008
Key2=402870548C92DDBFF2C8EC432F420FC9540F6531F47BE0DA35211C8D964E7361

rednaxela
2006-12-23, 00:17
the length of index is now located at 0x20, and it has been encrypted with simple byte-level xor.
you don't really have to know how blowfish works, though, just use open source libs that can be found everywhere. the blowfish part in full ver. of ef hasn't been changed much.

kyun
2006-12-23, 03:16
If it's not a problem, do you think you could check to make sure I'm doing the xoring part right? For the script file, I get 130Bh. What do you do with the 32 bytes before that? Ignore them?

rednaxela
2006-12-23, 11:15
most of the first 32 bytes seems to be garbage (but i'm not sure), but you want to notice the byte at 0x08, that's the byte you'll be xoring with before you get to BlowfishDecrypt.

so, you'd:

> read in the first 32 bytes in the archive, save the byte at offset 0x08, and then dump the rest of them
> xor this "key byte" with every byte of a 4-byte integer at offset 0x20, and that's the length of index
> read in the index, xor hrough it with the "key byte", then BlowfishDecrypt it with the first set of Blowfish key. now you've got the index ready to use
> to extract files from the rest of the archive, xor with the "key byte" first and then BlowfishDecrypt.

just to mention that, in full version of ef, the initialization of pbox is somehow different from standard Blowfish and from ef_trial. in ef_trial, you have to negate every key byte before it's used in an otherwise standard Blowfish init.

so if you had a standard implementation of Blowfish, in ef_trial you'd: (pseudo code)

negateAllBytes(key1);
BlowfishInit(key1);

now in full version you have to do something tricky, so let's get more into the details of what would be a part of BlowfishInit. the code snippet below should replace the round of xoring pbox with the key for Blowfish: (in C++)

suppose:
unsigned int pbox[18]; // the pbox of Blowfish
byte* key; // pointer to the key for Blowfish, and that the length of key is always 0x20 in minori's games
then,

unsigned int ofs = 0; // offset of current byte in key

for (int i = 0; i < 18; ++i) { // iterate though pbox
unsigned int build = 0;
for (int j = 0; j < 4; ++j) { // retrieve 4 bytes from the key at a time
byte currentByte = key[ofs];

/////////////////////////////////////////////////////////////
// this switch is what's different from the standard Blowfish
switch (ofs &#37; 6) {
case 0:
currentByte ^= 0x6D;
break;
case 1: case 5:
currentByte ^= 0x69;
break;
case 2:
currentByte ^= 0x6E;
break;
case 3:
currentByte ^= 0x6F;
break;
case 4:
currentByte ^= 0x72;
break;
}
/////////////////////////////////////////////////////////////
build <<= 8;
build |= currentByte;
ofs++;
ofs &= 31; // ensure ofs doesn't go beyond 0x20
}
pbox[i] ^= build;
}


and that's about it...hopefully i made myself clear enough. read the algorithm of Blowfish should the code snippet above be confusing

kyun
2006-12-23, 12:30
That makes a lot of sense now. The code snippet I'm going to have to look at more, but the beginning part with 0x08 being used to XOR the 4 bytes at 0x20 helped a lot. :) I'm looking at the code now used for ExtractData and this is their decryption routine:

void Cef_first::Decrypt(LPVOID data, DWORD data_size)
{
BYTE deckey = m_deckey;
LPBYTE pData = (LPBYTE)data;
for (int i = 0; i < (int)data_size; i++)
pData[i] ^= deckey;
}

m_deckey is the byte at 0x08 if I'm reading the init code correctly. Cef_first::DecodeKeyTable() is very similar to what you have in your code snippet too, so it helps to see it in action.

I'll see what I can do with the information you've provided and the code I'm looking at now. Thanks for the help. :)

rednaxela
2006-12-23, 12:52
that's because DecodeKeyTable() method in class hierarchy of CPaz from ExtractData is equivalent to the first part of Blowfish init what might be called init()/SetKey()/whatsoever...

and that the mapping is found through debugging. this part of everyone's code should seem somewhat alike.

Unregistered
2006-12-31, 10:01
I use ExtractData successful unpack the files from ef_first(full ver.)
but I don\'t know how can I repack these files
and I know nothing about program...
does anyone have a tool for repack the paz?

Unregistered
2006-12-31, 10:11
I use ExtractData successful unpack the files from ef_first(full ver.)
but I don\'t know how can I repack these files
and I know nothing about program...
does anyone have a tool for repack the paz?

roxfan
2007-01-08, 14:27
Here's the source. I don't have the game myself.

Enerccio
2007-04-28, 09:55
So is there a functional exe that can use english characters?

Misu
2007-04-28, 11:07
Yeah, Wind -a breath of heart- used this. If you need the functional exe, you can talk to GipFace of NNL for it.

Enerccio
2007-04-28, 11:13
Where can I ask them?

Misu
2007-04-28, 11:15
PM here, or you can head over to NNL's IRC Channel on irc.zirc.org/#NNL.
Gip requires a fairly compelling argument to hand out the exe though, so if your not going to work on a minori/musica based game, he probably wont hand it over to you.

Enerccio
2007-04-28, 11:24
Uh, my friend is willing to translated Ef - Fairy tale of Two complete game so I need to code that in engine...