Author Topic: [FF7] Scene.bin Lookup Table updater  (Read 16733 times)

kruci

  • *
  • Posts: 105
    • View Profile
[FF7] Scene.bin Lookup Table updater
« on: 2007-09-27 18:54:58 »
Here program witch I made, becouse we needed it.

What it does:
Update Scene.bin Lookup table in unpacked 3rd file of kernel.bin. Update is based on header data from scene.bin

Why it does it:
if you change scene.bin, headers can differ. You can see mosters in bad places, other monster instead boss,.... So Lookup table is not actual to current scene.bin. It need update.

What it need:
Scene.bin
unapcked 3rd file of kernel.bin

How to use:
ff7StoK [Scene.bin] [unpacked 3rd file of kernel.bin]
default file names are scene.bin and kernel.bin2
it doesnt care if that are not right files

example:
ff7StoK
;try open files scene.bin and kernel.bin2, if found, update kernel.bin2 based on data in scene.bin

ff7StoK SOMEfilename
;try open files SOMEfilename and kernel.bin2, if found, update kernel.bin2 based on data in SOMEfilename

ff7StoK SOMEfilename SomeFilename2
;try open files SOMEfilename and SomeFilename2, if found, update SomeFilename2 based on data in SOMEfilename

output:
none if succesfull
some error message if error.

bugs:
currently none

Where:
here http://kruci.wz.cz/ff7stok.7z
or zip here http://kruci.wz.cz/ff7stok.zip

Tech info:
http://forums.qhimm.com/index.php?topic=5759.msg74232#msg74232
http://forums.qhimm.com/index.php?topic=6391.msg80497#msg80497

technical update:
in original scene.bin last block has 11files
in original 3rd file of kernel.bin is for last block F5h-FFh
but this mean according to links above FF minus F5=10files or F5 to FE files (10files)
(FF minus 0 = 255files, files from 0 to FE = 255files, but scene.bin has 256files)
so last is FFh instead of "100h".

last file of scene.bin(256th file) contain only FFh chars.(5,251-256 are same)


I can release source code too, if anyone wants, but this program is simply.
« Last Edit: 2018-04-20 19:03:54 by Covarr »

ARMs

  • *
  • Posts: 164
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #1 on: 2007-09-27 21:48:53 »
Thanks alot.

Ragna

  • *
  • Posts: 266
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #2 on: 2007-09-28 12:01:47 »
Hi, thank you so much, but, can you explain to me on how to use that?

I tryied with the command promt and I just can't get how to use it,
my PC doesn't even recognize the extension (me too xDD) or something @_@

Pleaseee! Thank youu! ^^U

kruci

  • *
  • Posts: 105
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #3 on: 2007-09-28 12:09:56 »
ah do you think ff7stock.7z?
7z is archive which you need uncompress www.7-zip.org.
I wanted give it to zip archive, but accidently I used 7z, so now is there zip too.
« Last Edit: 2007-09-28 12:14:13 by kruci »

Ragna

  • *
  • Posts: 266
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #4 on: 2007-09-28 13:34:23 »
I still can't do a thing, And the "zip" is the same as the other file @_@

Or maybe I'm so silly XD

Synergy Blades

  • Guest
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #5 on: 2007-09-28 14:36:00 »
Didn't you think to try sticking .zip on the end: http://kruci.wz.cz/ff7stok.zip:wink:

kruci

  • *
  • Posts: 105
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #6 on: 2007-09-29 08:09:17 »
I still can't do a thing, And the "zip" is the same as the other file @_@

7z, and zip are compressed files, so you must unpack them to get files inside.

Salk

  • *
  • Posts: 608
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #7 on: 2007-10-08 07:19:17 »
I tried to run your program, kruci.

First let me just explain a little better to other potential users how to run it because your instructions, with all due respect, are very hard to understand.

The user can simply unzip the .EXE file (ff7StoK.exe) in the main FF7 directory. Then copy paste the modified Scene.bin and the original kernel.bin (ambiguous here: you wrote "kernel.bin2" which does not exist but I guess you meant "kernel.bin" instead? I am asking because there is also a kernel2.bin making things all the more confusing) to the same directory.

The copied kernel.bin will need to have the "Read Only" tag unchecked by right clicking on it and choosing "Properties".

Then from the Command window, you will write:"ff7StoK.exe scene.bin kernel.bin"

I did that and the program patched the kernel.bin without any error message.

The problem is that as I run the game, the computer just locks forcing me to a hard reboot.

Please, kruci, could you just try and make my  Scene.bin work on your installation?

I would be very greateful if you could test it for me since from my side I seem I can't make it work right.

If you could do this favour to me, please just tell me and I will send you a PM with the link to my modified SCENE.BIN

Thanks a lot!

ARMs

  • *
  • Posts: 164
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #8 on: 2007-10-08 07:29:39 »
I think you were suppose to mantually extract the 3rd file and then decompress it.    After wards you run the program using the scene.bin and the uncompressed file 3. 

I ran the program this way and it didn't change a single thing on my file so i'm guessing my scene file didn't grow in size or cause any programve after small amounts of tweaking.

Salk

  • *
  • Posts: 608
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #9 on: 2007-10-08 08:40:21 »
Oh okay, then it's even more complicated than I thought. How do I extract the third file of the Kernel.bin?

kruci

  • *
  • Posts: 105
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #10 on: 2007-10-08 09:09:14 »
recreate scene.bin with Sceneexplorer
recreate kernel.bin with ff7dec(extract, update third file)
ff7dec here http://forums.qhimm.com/index.php?topic=6621.0

and ff7dec need fix...
you must get gunzip (there is not gunzip, but gzip renamed to gunzip)
or create bat file
gunzip.bat
containing
Quote
gzip -d %1 %2

this will work as gunzip, but of course there must be gzip. And of course you must delete/rename gunzip.exe.
« Last Edit: 2007-10-08 09:45:32 by kruci »

ARMs

  • *
  • Posts: 164
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #11 on: 2007-10-08 09:15:47 »
What version is FF7dec for?  PC, PSX, or Both?

kruci

  • *
  • Posts: 105
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #12 on: 2007-10-08 09:42:22 »
ff7dec is bin file extractor(gzip bin files), so it should extract all those types. And I think that kernel.bin is same on PC and PSX version.

kruci

  • *
  • Posts: 105
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #13 on: 2007-10-08 10:14:54 »
how to create updated kernel.bin

you need scene.bin
you need unpacked 3rd file of kernel.bin, usualy named kernel.bin2

if you have those two files, you only need run ff7stok, no need of parameters(if you dont rename scene.bin or kernel.bin2)


how to get kernel.bin2

get ff7dec
here: http://lasyan3.free.fr/otherstools/ff7_gzip.zip
or here: http://spinningcone.com/ff/stormmedia/projects/ff7_gzip.zip
(topic how decompile kernel.bin http://forums.qhimm.com/index.php?topic=6621.0)

BUT FF7dec has error. This error is gunzip, gunzip there dont unpack, unless parameter -d is given.
So get gunzip. Or create gunzip.bat.

Creating gunzip.bat
(delete or rename gunzip.exe)
create gunzip.bat (create empty file, rename to gunzip.bat)
edit gunzip.bat and give there: gzip -d %1 %2
Code: [Select]
gzip -d %1 %2save gunzip.bat

(or create TXT file, then rename,...)

how to decompile kernel.bin
(topic how decompile kernel.bin http://forums.qhimm.com/index.php?topic=6621.0)
its comand line program
Use this command to decompile kernel.bin:
Code: [Select]
ff7dec d kernel.bin(or create BAT file, similar way as above, only give ff7dec d kernel.bin to file(example kerneldecompile.bat), save)
now in same directory as kenrle.bin should be files, kernel.bin0, kernel.bin1, kernel.bin2, ...

how to compile
Use this command to compile kernel.bin:
Code: [Select]
ff7dec e kernel.bin(or create BAT file, similar way as above, only give ff7dec d kernel.bin to file(kernelcompile.bat), save)



Quick review, if you created BAT files, and you have scene.bin and kernel.bin, and followed way above:
Run kerneldecompile.bat
Run FF7stok.exe
Run kernelcompile.bat

or of course create BAT file with
Code: [Select]
kerneldecompile.bat
FF7stok.exe
kernelcompile.bat
and run only this bat file...

Salk

  • *
  • Posts: 608
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #14 on: 2007-10-09 06:52:56 »
Thank you very much, kruci!

It worked like a charm!  :-)

ARMs

  • *
  • Posts: 164
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #15 on: 2007-10-19 14:08:54 »
I can't seem to get ff7dec.  Is there a working link?

kruci

  • *
  • Posts: 105
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #16 on: 2007-10-19 15:23:10 »

ARMs

  • *
  • Posts: 164
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #17 on: 2007-10-19 16:38:10 »
oops i downloaded that but i though it was gzip not dec.

is there a version of this program that will compress all 27 kernel files instead of stopping at 21, so that it can be used for the psx version.

It decompiles perfectly but when compiling it wont compiles kernel.bin21 to 26.
« Last Edit: 2007-10-19 17:14:35 by ARMs »

mav

  • *
  • Posts: 239
  • The Sauce team
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #18 on: 2007-10-19 18:43:33 »
ARMs: I have in plans making a generic program to export/import files from GZIP-Bin archives, so it'll do what you want. Stay tuned :).

kruci

  • *
  • Posts: 105
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #19 on: 2007-10-19 19:01:37 »
is there a version of this program that will compress all 27 kernel files instead of stopping at 21, so that it can be used for the psx version.

It decompiles perfectly but when compiling it wont compiles kernel.bin21 to 26.

FF7dec
I dont have this problem when using ff7dec on kernel.bin, it looks like it works good, unpack/pack all 27 files.. tested only on PC kernel.bin, changed only part2...

ARMs

  • *
  • Posts: 164
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #20 on: 2007-10-19 20:14:46 »
Thanks M4v3R your a great guy.   Glad to see you back on this forum.  During my year or so of browsing this forum I didn't notice seeing you.   Well i only checked topics that i am interested in, so it isn't much.

I have been working on kernel.bin manually but since there is a program that can do it automatically for the PC version I though i might as well ask for a PSX version.
« Last Edit: 2007-10-19 20:17:56 by ARMs »

mav

  • *
  • Posts: 239
  • The Sauce team
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #21 on: 2007-10-19 20:36:31 »
Thanks M4v3R your a great guy.   Glad to see you back on this forum.  During my year or so of browsing this forum I didn't notice seeing you.

Well, that's probably because I weren't here for a while (a year and a half maybe) :). You could still find my older posts, from 2003 - 2005 though.

As for the program - I'm aiming to learn how to develop a Windows.Forms app on Linux, and this will be my teaching project. So yes, this one will be with (pretty or not) GUI. Maybe after the weekend?

ARMs

  • *
  • Posts: 164
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #22 on: 2007-10-19 20:46:38 »
Thats cool i'm in no rush i can always to things manually until then.   By any chance is it even possible for guys like you to take a look at some other games data and maybe conclude what kind of a compression program or method other games uses.   

I'm just asking cause I unfortunately dont' knwo any programing language and only learned a few things from stuff like rpg makers and working on hacking ff7.

I'm thinking of messing around with wild arms 5's battle data but I have no idea on how to even go about trying to decompress its datas.  Its a great game, and i love it but Wanted it harder heh.

mav

  • *
  • Posts: 239
  • The Sauce team
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #23 on: 2007-10-19 20:50:00 »
Well, I'm a programmer, not a game hacker ;). I hacked few games to some degree, but I'm nowhere as advanced as Qhimm, Terence F. and other smart people here.

And I don't own the game :).

ARMs

  • *
  • Posts: 164
    • View Profile
Re: [Relaese] Scene.bin Lookup Table updater
« Reply #24 on: 2007-10-19 21:02:48 »
hmmm just curious what games have you hacked.  Maybe it'll interest me.  give me something else to do instead of ff7.   Cause at this point i know pretty everything about ff7 that i want to know like, kernel, field scripts, scene, shops, and a few lucky attempts at other areas of ff7.


Just to let you know 0x0348 to 0x034B is the first enimies status imunities.  its the same data as inflicting statuses but in reverse.   Like say if the data is 00 00 00 00 that monster will be imune to everything.

maybe you can use this to update your scene editor.
« Last Edit: 2007-10-19 21:07:45 by ARMs »