ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Fri Oct 20, 2017 11:21 pm

All times are UTC




Post new topic  Reply to topic  [ 40 posts ]  Go to page Previous 1 2
Author Message
PostPosted: Wed Sep 21, 2016 9:18 pm 

Joined: Thu Sep 15, 2016 10:17 pm
Posts: 4
thank you aluigi it's work :) :) :) :) :)


Top
   
PostPosted: Sun Nov 27, 2016 10:54 am 

Joined: Sun Nov 27, 2016 10:50 am
Posts: 1
Hi,
I am working on an italian translation of Undertale, still work in progress, but I want to test out the graphical translation. To decrypt the data file from data.win, I used yoyogames.bms script, which worked as expected, but now I can't encrypt them again in a data.win file.
Any suggestions on which script to run? I've tried reimport.bat but I can't comprehend the use of it. Such a noob I am :roll:
Thanks for the great job you're doing.


Top
   
PostPosted: Sun Nov 27, 2016 11:44 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6885
reimport.bat is very simple and it's explained in section 3 of http://aluigi.org/papers/quickbms.txt

In short you should click on reimport.bat and select the same script, archive (remember to make a backup!), and folder (that now acts as "input") you selected during the extraction.

The following are some rules to increase the chances of a good reimporting:
  • in the folder where you extracted the files, keep there only those you edited and delete the others (this is useful mainly for compressed files)
  • the edited files (for example graphics in your case) must have a size which is smaller or equal than the originals
  • for your translation you are probably going to edit STRG.txt, remember to keep your new strings (each line) shorter/equal than the originals
  • in some rare archive formats it's even necessary to keep the new string with the same length of the original, so filling it with spaces, but this is not the case of Undertale probably

If you have other doubts do a search on google with the following keywords because other people had success in modding Undertale and made videos and tutorials:
Code:
undertale quickbms reimport


Top
   
PostPosted: Thu Jan 12, 2017 11:21 pm 

Joined: Thu Jan 12, 2017 11:18 pm
Posts: 3
Hello

I try to edit some staff in alpine ski racing 2007 game. Sometimes re-importing works, sometimes not. Edit I tried is really simple. For example, I only exchanged one number for another or something like that.
When re-importing is not working, mostly, I got this message:

Last script line before the error or that produced error:
26 clog NAME OFFSET ZSIZE SIZE



Please, any ideas how to solve this?
Thank you so much


Top
   
PostPosted: Fri Jan 13, 2017 4:57 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6885
That script (49games.bms) is not valid for reimporting because the re-compression algorithm is not available.


Top
   
PostPosted: Fri Jan 13, 2017 5:20 pm 

Joined: Thu Jan 12, 2017 11:18 pm
Posts: 3
aluigi wrote:
That script (49games.bms) is not valid for reimporting because the re-compression algorithm is not available.


Thank you for answer.
Is there available any scrip that has this algorithm? If not, is there any chance for this algorithm to be added there?
Btw, despite this fact, I even succeeded in re-importing some files.
Please help, I play this game every ski season for more 10 years now (because there is never new ski game... :cry: :cry: :cry: ) so if I could make at least slight editing to feel it more enjoyable. Thank you so much for your help. :)


Last edited by skiracing on Fri Jan 13, 2017 5:40 pm, edited 1 time in total.

Top
   
PostPosted: Fri Jan 13, 2017 5:33 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6885
No, the only solution would be to check if the game works with the extracted files and without the original archive (probably doesn't work or requires specific folders).
Writing a rebuilder (with compression disabled) may be an option but you have to do it by yourself or finding someone who wants to do it.
You can also try some hacks on the archive with a hex editor like disabling the compression for that file, appending the content of the new file to the archive and editing the offset, size and crc field (and the method as already said).
Unfortunately with edited files the options are ever quite limited and I offer no support on this stuff, sorry.


Top
   
PostPosted: Fri Jan 13, 2017 5:49 pm 

Joined: Thu Jan 12, 2017 11:18 pm
Posts: 3
Ohh..thank you for explanation.

I'm totally dumb on hacking and stuff like that and even do not understand anything about those methods that you are telling. Oh well, it is only hope maybe sometimes in future it will be possible to re-import edited files in the game. For now, at least I know there is no sense to trying more. Thanks anyway.


Top
   
PostPosted: Sun Feb 05, 2017 8:04 pm 

Joined: Sun Feb 05, 2017 7:35 pm
Posts: 5
aluigi wrote:
It's a problem of physical space, so there is no ready solution except writing a rebuilder from scratch (the format is not complex) or just appending the new content to the file and then modifying the OFFSET and SIZE field in the archive (something that requires manual work but may be easy with the help of quickbms -l -V).

Hello, could you please provide (or link) an example on how to modify the offset and size field in an archive ? I'm currently making a voice mod, and i literally need to slaughter the soundtracks quality in order for them to "fit" in the original archive, which is not good at all :/
( If needed, i attached here the quickbms scipt i'm using, an archive and an ogg file i would like to inject in this archive)


Attachments:
test.rar [69.84 KiB]
Downloaded 50 times
Top
   
PostPosted: Sun Feb 05, 2017 8:58 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6885
Ok, I will explain what's the normal method because you cannot use it in your situation since you have an encrypted TOC (the information about the archived files).
Sorry.

You need to run quickbms with the -l (list because you have already extracted the files) and -V option, example:
Code:
quickbms -l -V script.bms archive.dat > info.txt

When you open info.txt you can notice the following fields:
  • a dot
  • hexadecimal offset where is located the data read from the file
  • bms instruction used
  • name of the variable
  • value that has been read
  • size or type of value, usually just the size of the field (1 for byte, 4 for long and so on, N for strings)

The following is an example of these information:
Code:
. 00000012 get     comp_size  0x000032b4 4
. 00000016 get     uncomp_size 0x0000981a 4
. 0000001a get     name_len   0x0000000d 2
. 0000001c get     extra_len  0x00000000 2
. 0000001e getdstr name       "changelog.txt" 13
    63 68 61 6e 67 65 6c 6f 67 2e 74 78 74            changelog.txt
. 0000002b getdstr extra      "" 0
  0000002b 38938      changelog.txt

Now if you want to edit the offset and size of an archived file:
  • open the archive with a hex editor
  • go to the offset of the variable you want to change (the hexadecimal value after the dot)
  • put your new value overwriting the old one

So let's say you want to change the compressed and decompressed size of the previous example I provided, you have to go to offset 0x12 replacing 0x32b4 with the new one, and then do the same at offset 0x16 for 0x981a.

Yeah it's very simple if they are just few files.


Top
   
PostPosted: Thu Feb 09, 2017 2:03 am 

Joined: Sun Feb 05, 2017 7:35 pm
Posts: 5
Ah, that's sad :/ But as i can see (i think ...), the quickbms script i'm using contains decryption keys for my archive. So my question is, can impliment this method directly into a quickbms script, so that he list the files and change the offset variables i want ? Or Quickbms can't directly modify an archive ?


Top
   
PostPosted: Thu Feb 09, 2017 9:10 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6885
Quickbms can modify archives, there are instructions like Put that do this job and the log/clog commands can be used to write data into the input archive too (with "append 1").
If you have time, perfect skills with quickbms and you have the re-encryption function probably you can (but don't expect any time and help from me, sorry)


Top
   
PostPosted: Thu Feb 09, 2017 10:53 am 

Joined: Sun Feb 05, 2017 7:35 pm
Posts: 5
It's ok, thank you very much for the information, it will help me in the future :D


Top
   
PostPosted: Mon Apr 17, 2017 2:17 pm 

Joined: Mon Aug 22, 2016 10:30 am
Posts: 119
Hi aluigi, how I can do for reimport a folder with a file inside for a archive? I've read the section 3 of manual, but I didn't understood the steps for reimport folders with files inside.


Top
   
PostPosted: Mon Apr 17, 2017 2:32 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6885
The process is completely automatic and, remember, you can reimport only what has been extracted (what already existed in the archive and you have modified), so if you are thinking about adding new files/folders then you can't.


Top
   
PostPosted: Mon Apr 17, 2017 3:31 pm 

Joined: Mon Aug 22, 2016 10:30 am
Posts: 119
The folder that I'm trying to reimport has been extracted from archive. The archive have manys folders and chunked files, I'm using the asura script, here is the archive: https://drive.google.com/file/d/0B-izXc ... p=drivesdk


Top
   
PostPosted: Mon Apr 17, 2017 3:43 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6885
Recent asura archives are entirely compressed so the script decompresses the input archive in a temporary file which is then used as source for the extraction.
In that scenario you can't use the reimport feature of quickbms because the data doesn't come directly from the input archive.
Luckily that's not your case but I want to warn people if they encounter that case.

Regarding your case there is nothing special except various files that have the same name and so they can't be reimported correctly.
What I mean is that if you can't reimport the files you are using the reimport feature in the wrong way.
Solution: READ section 3 for real and do the SAME steps you did during extraction.


Top
   
PostPosted: Mon Apr 17, 2017 3:59 pm 

Joined: Mon Aug 22, 2016 10:30 am
Posts: 119
I've searched in net and it seems there is a unpacker/repacker tool for the asura format, but all the links that I have tried are broken! I would like aluigi if you have this tool for send to me, I've read the SECTION 3 and the reimport didn't work, the quickbms close automatically. I need it so much of this tool, It looks like it was made by Terry Buttler, but the download link in official site is not working. In asura script there is a citation about this author, please, if you have this tool send for me, I will be very grateful, very
much.


Top
   
PostPosted: Sun Jul 02, 2017 5:50 am 

Joined: Sun Jul 02, 2017 5:40 am
Posts: 1
This has been addressed before, but since I can't find an answer, I'd like your help with it.
Following is the cmd log (I used the reimport batch file)

Code:
QuickBMS generic files extractor and reimporter 0.8.0
by Luigi Auriemma
e-mail: me@aluigi.org
web:    aluigi.org
        (Mar 12 2017 - 15:03:46)

                   quickbms.aluigi.org  Homepage
                            zenhax.com  ZenHAX Forum
                               @zenhax  Twitter & Scripts

- GUI mode activated, remember that the tool works also from command-line
  where are available various options like folder scanning, filters and so on

- select the BMS script to use
- select the input archives/files to extract, type * or "" for whole folder and
subfolders
- select the output folder where extracting the files
- REIMPORT mode enabled!
  - remember to select the SAME script, file and folder you selected during
    the previous extraction
  - it's highly suggested to leave only the edited files in the folder, it's
    faster and less prone to errors with compressed files
- open input file C:\XYZ\!Games\Onigiri\MOD\ORG\avatar_body-000d.kxr
- open script C:\XYZ\!Games\Onigiri\MOD\SCRIPTS\onigiri_online.bms
- set output folder C:\XYZ\!Games\Onigiri\MOD\OP TRIAL

  offset   filesize   filename
--------------------------------------

- the script needs to load a pre-compiled function from the dll or code
  MEMORY_FILE3
  do you want to continue with this and any other requested dll/code (y/N)?
  y
- library MEMORY_FILE3 loaded at address 0F7C0000
- function found at offset 0F7C0000
-
- 0 files reimported in 3 seconds
  coverage file 0     1%   1350274    84488400   . offset 00000010
  coverage file -1  100%   21177      21177      . offset 000052b9
  coverage file -2    0%   0          363        . offset 00000000
  coverage file -3    0%   0          69         . offset 00000000

Press ENTER or close the window to quit


The game is Onigiri Online, so the script is correct.
Next about the files and folders,
-I extracted 'avatar_body-000d.kxr' from folder ORG to folder 'OP TRIAL'
-I edited .dds file '81.dds' (original file size 171 KB), and compressed it (modded file size 129 KB)
-I deleted everything else in the output folder
-I run reimport.bat
-I choose the same script, input folder as 'ORG' and .kxr file, and output folder as 'OP TRIAL'
-I continue as shown above

It says, as can be seen, 0 files reimported. I am tempted to try it out anyway, but common sense says it probably didn't work.

Any and all help would be appreciated.


Top
   
PostPosted: Thu Jul 20, 2017 3:54 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6885
The onigiri script has one type of file (type 0) that can't be reimported since it's dumped from the memory instead of the file (it requires custom decryption), while the other types are ok.
It "seems" you selected the same files and folders of the extraction so it should be ok, that's why I don't get why there are 0 files found.
The simplest test you can do is just the following, if reimporting works here then there is no problem:
Code:
quickbms       onigiri_online.bms PATH\avatar_body-000d.kxr PATH\output
quickbms -r -w onigiri_online.bms PATH\avatar_body-000d.kxr PATH\output
I don't have an Onigiri sample so if the problem persists would be useful if you can provide avatar_body-000d.kxr


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 40 posts ]  Go to page Previous 1 2

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited