NFSAddons Forums

Jan 18, 2021, 6:47 PM

unvivtool - portable VIV decoder/encoder (NFS3-5)

This is a discussion for the topic unvivtool - portable VIV decoder/encoder (NFS3-5) on the board General NFS.

Author Topic: unvivtool - portable VIV decoder/encoder (NFS3-5)  (Read 443 times)

8 Replies on unvivtool - portable VIV decoder/encoder (NFS3-5)
on: Dec 01, 2020, 3:59 PM
Rookie Member
Posts: 6 Joined: December 01, 2020

  • *
New VIV encoder/decoder.

unvivtool
https://github.com/bfut/unvivtool

Download: https://github.com/bfut/unvivtool/releases

Portable, open-source approach under a permissive license.

Features:

*    chunked I/O for low memory usage
*    numerous format checks
*    optionally lists archive contents without writing to disk (encode/decode)
*    batch decodes/encodes multiple archives (example scripts provided)
*    decodes an entire archive at once or retrieves a single file either by index or by filename
*    surgically retrieve a single file, by offset and/or filesize, from archive with broken header

All documentation can be found in the GitHub repo.

« Last Edit: Dec 05, 2020, 8:29 PM by bfut »

Reply #1
on: Dec 02, 2020, 6:55 AM
Hero Member
Posts: 365 Joined: October 20, 2007

  • *****
Hey bfut,

welcome to the forum  :)
Nice utility that does what it says. Meant to be executed right at file location.
Do you intend further improving the utility?
I noticed, using full file-paths with spaces, special characters or vowel mutation in the command string, will result in error.
Functionality for execution by filetype (using "*.viv" for example) would be neat too, at the moment you always have to give the exact file name.

Greetings

Reply #2
on: Dec 02, 2020, 1:58 PM
Rookie Member
Posts: 6 Joined: December 01, 2020

  • *
Hey bfut,

welcome to the forum  :)
Nice utility that does what it says. Meant to be executed right at file location.
Do you intend further improving the utility?
I noticed, using full file-paths with spaces, special characters or vowel mutation in the command string, will result in error.
Functionality for execution by filetype (using "*.viv" for example) would be neat too, at the moment you always have to give the exact file name.

Greetings

Thanks for the feedback! Love to be here. :)

Hmm, I cannot reproduce your issue. Which OS are you on? Can you post steps to reproduce?

Paths with spaces have to be enclosed with double quotes (") on Windows, either single (') or double quotes in bash.
I will usually just drag files into the terminal window to get full paths already in quotes.

The program executes for one VIV archive at a time. For wildcards / batch execution, I recommend using batch scripts. Examples are provided in the batch folder in the repo.

When decoding (extracting an archive), unvivtool extracts into the the same directory by default. It is possible to specify a custom output path as argument. The UNIX standard "." shortcut for current working directory is accepted, too.

Any issues, questions or feedback, definitely keep it coming. :)
« Last Edit: Dec 02, 2020, 2:02 PM by bfut »

Reply #3
on: Dec 03, 2020, 11:28 AM
Hero Member
Posts: 365 Joined: October 20, 2007

  • *****
Uh, yeah running Windows! Tested the tool on Win7 64bit.
So i cannot verify your Linux-scripts (.sh files).

Executing the tool inside the directory works perfectly fine.
Code: [Select]
unvivtool d car.viv
or
unvivtool d car.viv car

But that means you need to copy files from a to b everytime... or maybe my train of thoughts is wrong here?
Also paths without spaces work:
Code: [Select]
C:\unviv>unvivtool d -o C:\unviv\car.viv C:\unviv\car\
=======================================================================
unvivtool 1.0 - Copyright (C) 2020 Benjamin Futasz (GPLv3) - 2020-11-24

Archive: C:\unviv\car.viv
Extracting to: C:\unviv\car\
Decoder successful.

Using full paths (via .bat-file or cmd.exe) with single quotes (') or double quotes (") gives me an error, tho.
Code: [Select]
C:\unviv>unvivtool d -o C:\unviv\car.viv "C:\unviv\car\" #Just an example, these quotes aren't neccessary here
=======================================================================
unvivtool 1.0 - Copyright (C) 2020 Benjamin Futasz (GPLv3) - 2020-11-24

Archive: C:\unviv\car.viv
Extracting to: C:\unviv\car"
Not enough memory
Decoder failed.

Greetings

Reply #4
on: Dec 03, 2020, 1:33 PM
Rookie Member
Posts: 6 Joined: December 01, 2020

  • *
Thanks! The tool is supposed to run from anywhere, as full input and output paths may be passed as arguments, though this is of course at the user's discretion. So, I can't test on Windows 7 myself, and Extended support fir most versions of Windows 7 ended on January 14, 2020.

That said, the error here is "Not enough memory.", which means memory allocation fails.

Can you run the working variant with the "-p -strict" options and post the output here? "-p" lists archive contents and additional info. "-strict" enforces the VIV format specs a bit more.

Afterwards, can you see if this still happens with today's version? This one fixes a potential crash.
 https://github.com/bfut/unvivtool/releases


edit: Your feedback has already been very helpful.
« Last Edit: Dec 05, 2020, 8:26 PM by bfut »

Reply #5
on: Dec 05, 2020, 8:28 PM
Rookie Member
Posts: 6 Joined: December 01, 2020

  • *
New version is up. Added several new format checks, and stability improvements. New batch script example, too. Feedback appreciated. Enjoy.

Reply #6
on: Dec 06, 2020, 5:05 PM
Hero Member
Posts: 365 Joined: October 20, 2007

  • *****
Hello,
i've ran a test with the new version (unvivtool10+dev201206-win32.zip) on Win10 64bit.
I noticed you restricted the output to a subdirectory of the input path, so output command can only be a folder name
(message "must only contain the following characters 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").

The application path now working fine with single quotes (') or double quotes (") and spaces.
Code: [Select]
C:\un viv>unvivtool d -o "C:\un viv\car.viv" "car extracted"
=================================================================================
unvivtool 1.0+dev201206 - Copyright (C) 2020 Benjamin Futasz (GPLv3) - 2020-12-06

Archive: C:\un viv\car.viv
Extracting to: car extracted
Archive Size (parsed) = 10530811
Directory Entries (header) = 24
Decoder successful.
Extraction works fast and flawless so far, tested different archives from NFS2 (cardata.viv), NFS3, NFS4 and NFS6.

Just have to point out the issue with special characters and vowel mutation again, used in many regions, thus appearing in filepaths probably.
Code: [Select]
C:\n viv>unvivtool d -o "C:\├╝n viv\car.viv" "car extracted"     #filepath with "" instead of "u" results in error
=================================================================================
unvivtool 1.0+dev201206 - Copyright (C) 2020 Benjamin Futasz (GPLv3) - 2020-12-06

Archive: C:\++n viv\car.viv
Extracting to: car extracted
File 'C:\++n viv\car.viv' not found
Decoder failed.
Maybe you can define/implement a different character set (Unicode, ANSI etc.) with the application (not to mention russian, arabic or chinese)?
Dunno how much of a hassle it is, to make the program "multilanguage"?  :)

Furthermore, the encoding side still seems a little cumbersome, again requiring to place unvivtool.exe inside execution-path... if i understand correctly.
Wouldn't it be more convenient to give a folder or path, packing all files inside into the viv-file?

Greetings

Reply #7
on: Dec 07, 2020, 2:51 PM
Rookie Member
Posts: 6 Joined: December 01, 2020

  • *
Furthermore, the encoding side still seems a little cumbersome, again requiring to place unvivtool.exe inside execution-path... if i understand correctly.
This is addressed in documentation.

Very strong words coming from an anonymous account. Can't win 'em all, I guess.

Reply #8
on: Dec 07, 2020, 3:49 PM
Hero Member
Posts: 365 Joined: October 20, 2007

  • *****
Hey,
not sure what documentation you are referring to? The readme only adresses general "encoding syntax" and one example:
Code: [Select]
unvivtool e [<options>...] <output.viv> [<input_files>...]
EXAMPLE 4
      unvivtool e CAR.VIV car.fce car00.tga carp.txt fedata.fsh fedata.eng

How to create a viv-file, without having the unvivtool.exe in that directory? Could you give an example?

[...] Very strong words coming from an anonymous account. Can't win 'em all, I guess.
I do not understand this, what are we talking about?

Greetings

 


Support NFSAddons: