reimporting files in padded offset

Programming related discussions related to game research
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

reimporting files in padded offset

Post by Shokoniraya »

how can i reimport a file with padded offset?
i had this problem in past but is there any way to do in reimport? it is possible to export padded file but how can i do it in import mode?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: reimporting files in padded offset

Post by aluigi »

I still have to investigate that so I don't know or remember the details.

In the meantime I need the exact script and sample for the test.
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: reimporting files in padded offset

Post by Shokoniraya »

here a sample
download/file.php?id=6160

offset padded to 64, but how can i reimport files as padded offset? game can't read offset if i add a none-padded file, but a padded file, even with a new offset can works fine
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: reimporting files in padded offset

Post by aluigi »

Ok I see.

The problem is very simple: reimport2 appends the file at the end of the archive but the end is not aligned, therefore the new offset will point to a wrong location some bytes before.

I will check what may be the best and simplest solution
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: reimporting files in padded offset

Post by aluigi »

The solution I just implemented in my beta works well.
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: reimporting files in padded offset

Post by Shokoniraya »

aluigi wrote:The solution I just implemented in my beta works well.

exactly. it's really important in New games or padded files
Thank you
GHFear
Posts: 290
Joined: Fri Mar 30, 2018 2:48 am

Re: reimporting files in padded offset

Post by GHFear »

Shokoniraya wrote:
aluigi wrote:The solution I just implemented in my beta works well.

exactly. it's really important in New games or padded files
Thank you


If it's the same padding each time or a pattern to it, couldn't you make a script that goes through the file and adds the NON-PADDED offsets to a location in the padding bytes, and then make a script only for importing by using those correct offsets., then make a third script that goes through the file and checks the newly printed offset in the padding, subtract your current offset, then take the new value and print that to the padded offset. then make a batch file for doing it automatically.

This way you could reimport to padded offsets or offsets that don't use actual offsets, but rather only a padding offset from the start of the filedata. anything like that.