ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Mon Nov 20, 2017 6:48 pm

All times are UTC




Post new topic  Reply to topic  [ 54 posts ]  Go to page Previous 1 2 3
Author Message
PostPosted: Thu Nov 09, 2017 9:34 pm 

Joined: Wed Sep 06, 2017 12:37 pm
Posts: 25
How to same pvr mod to original ? Bro?


Top
   
PostPosted: Thu Nov 09, 2017 10:09 pm 

Joined: Wed Sep 06, 2017 12:37 pm
Posts: 25
Your edited my fsh is work , but how same pvr mod to pvr original
Please help bro


Top
   
PostPosted: Thu Nov 09, 2017 10:33 pm 

Joined: Fri Oct 27, 2017 7:36 pm
Posts: 27
i don't speak gibberish. sorry sissy. :)

/thread2


Top
   
PostPosted: Thu Nov 09, 2017 11:47 pm 

Joined: Wed Sep 06, 2017 12:37 pm
Posts: 25
You ready aplication whats up bro


Top
   
PostPosted: Fri Nov 10, 2017 11:10 am 
User avatar

Joined: Mon Nov 07, 2016 5:49 am
Posts: 37
This is what we did:
After saving modded pvr,we replaced original 1 with the edited lowj.pvr(now folder only contains original fsh and edited pvr)
we run repack script but 0 file reimported!


Top
   
PostPosted: Fri Nov 10, 2017 4:11 pm 

Joined: Fri Oct 27, 2017 7:36 pm
Posts: 27
any errors printed in the console? use this if you don't see it. i can't make it red blinking signs sorry. lol

Code:
log memory_file 0 0

get fsize asize 0
log memory_file 0 fsize 0

set rmpd 0
set skpd 0

get oname filename 0
get fsig long memory_file
if fsig != 1229998163
   print "\nERROR %oname% is not a fsh file"
   print "\nUsage: input the fsh file you wanna repack"
   exit
else
   get osize long memory_file
   get files long memory_file
   get gsig long memory_file

   for file = 0 < files
      getdstring iname 4 memory_file
      get offset long memory_file
      savepos fpoint memory_file
      goto offset memory_file
      get nn byte memory_file
      get size_payload threebyte memory_file
      goto 0xc memory_file seek_cur

      string iname + .pvr
      open fdse iname 1 exists
      if exists = 0
         print "\nERROR %iname% not present in input folder - skipped"
         math skpd + 1
      else
         get psig long 1
         if psig != 55727696
            print "\nERROR %iname% is not a valid pvr file - skipped"
            math skpd + 1
         else
            goto 0x2c 1 seek_cur
            get size_meta long 1
            goto size_meta 1 seek_cur
            savepos ipoint 1
   
            get isize asize 1
            xmath fit "isize - ipoint"
            math size_payload - 0x10
            if fit <= size_payload
               math fit >> 2
               for transfer = 1 to fit
                  get data long 1
                  put data long memory_file
               next transfer
               math rmpd + 1
            else
               print "\nERROR %iname% too large. %fit% > %size_payload%"
               math skpd + 1
            endif
         endif
      endif
      goto fpoint memory_file
   next file

   print "\n%skpd% file(s) skipped - eventually check for ERRORs"

   if rmpd > 0
      string oname -= 4
      string oname += _repack.fsh
      print "\n%rmpd% file(s) imported"
      print "\n"
      log oname 0 fsize memory_file
   else
      print "\n0 files imported - check for ERRORs"
   endif

endif


if it doesn't write any file at all, i'm sure you missing the concept of it. you just execute the script. no bms reimport. and you gotta select the fsh as the input file.


Last edited by episoder on Fri Nov 10, 2017 6:34 pm, edited 1 time in total.

Top
   
PostPosted: Fri Nov 10, 2017 5:44 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 7113
Please note that it's not possible to "reimport" something which is not dumped from a file like a MEMORY_FILE input (for example a file built or edited in such MEMORY_FILE).


Top
   
PostPosted: Fri Nov 10, 2017 6:24 pm 

Joined: Fri Oct 27, 2017 7:36 pm
Posts: 27
aluigi wrote:
Please note that it's not possible to "reimport" something which is not dumped from a file like a MEMORY_FILE input (for example a file built or edited in such MEMORY_FILE).


does that mean if i'd just log the raw payloads when extracting, it would reimport backwards? in a loop too?

means that'd need a second and third script to header and strip the raw dump to/from pvr. right?


Top
   
PostPosted: Fri Nov 10, 2017 6:48 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 7113
For example this is ok for reimporting: log "out.dat" 0 SIZE
While this is not valid and completely ignored during the reimport process: log "out.dat" 0 SIZE MEMORY_FILE
That's because the reimport mode is nothing else than a reverse operation that works when you have a file input and a direct file output.

I quickly checked your script and it looks like you just edit one field in the input file through the "put" command, right?
There is not a dump/extraction process, it's an editing.

Honestly I don't know what to suggest except writing another script/tool.


Top
   
PostPosted: Fri Nov 10, 2017 7:11 pm 

Joined: Fri Oct 27, 2017 7:36 pm
Posts: 27
yep. i think i got this. reimports only direct logs as a form of copy with offset and size. ofc can't be done if the offset and size are computed or logged from a memory buffer. can't write backwards into a memory buffer. it won't reconstruct the file.

and, no, i'm not writing into the input file anymore. in the first version i did that, but hardrock complained about the -w option .bat not working. not sure what the issue was. doen't matter tho.

it seems all working now.


Top
   
PostPosted: Sat Nov 11, 2017 3:35 am 
User avatar

Joined: Mon Nov 07, 2016 5:49 am
Posts: 37
XD u both confused my humble little 2 no knowledge bout scripts!
(in a Smeagol voice): Pls episoder,master of script elements, wizard of binaries, pls explain to me the ez steps to repack these damned maleficient pvr's into beautiful fsh's!
Ex: 1. open xprogram
2. Select......
3. Press...
Etc....
Sry, im a gfx designer, aluigi already knows that i have very limitted knowledge bout scipts xD :lol:


Top
   
PostPosted: Sat Nov 11, 2017 5:46 am 

Joined: Fri Oct 27, 2017 7:36 pm
Posts: 27
since you got all in one folder just open quickbms. select the fsh_repack.bms (the last one i posted on this page). select the fsh file you wanna repack (the script will copy this file and load and import the modifed pvr data into this copied file). select the output folder.

if no _repack.fsh is written read the ERROR messages in the console. fix eventual errors, then try again. there's not a lot you could do wrong. you just gotta have same size pvr files with etc compression and mipmaps.

i mean it's not rocket science.


Top
   
PostPosted: Tue Nov 14, 2017 1:05 am 
User avatar

Joined: Mon Nov 07, 2016 5:49 am
Posts: 37
Anyway...thank you; episoder 4 ur Valuable help!
I had just 2 fresh install latest Qbms! It works now!
I can reimport! But still didnt test if it doesnt crash ingame! XD
And thanks Aluigi, cant say it enough bro!


Top
   
PostPosted: Thu Nov 16, 2017 1:44 am 

Joined: Wed Sep 06, 2017 12:37 pm
Posts: 25
Tread closed tanks to all master


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

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