NFSAddons Forums

Mar 28, 2024, 5:28 AM

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 12531 times)

46 Replies on unvivtool - portable VIV decoder/encoder (NFS3-5)
on: Dec 01, 2020, 3:59 PM
Sr. Member
Posts: 72 Joined: December 01, 2020

  • ***
Download unvivtool.exe CLI for Windows:
https://github.com/bfut/unvivtool/releases

Python module & unvivtool CLI for Linux:
https://github.com/bfut/unvivtool

unvivtool extracts and creates VIV archives. It is available as a command-line interface, and as a Python module. Developed for Windows and Linux.

Features:

*    decodes an entire archive at once or retrieves a single file either by index or by filename
*    optionally lists archive contents without writing to disk
*    numerous format checks
*    low peak memory usage

Extensive documentation can be found in the GitHub repo.


Reply #1
on: Dec 02, 2020, 6:55 AM
Hero Member
Posts: 368 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
Sr. Member
Posts: 72 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. :)

Reply #3
on: Dec 03, 2020, 11:28 AM
Hero Member
Posts: 368 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
Sr. Member
Posts: 72 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.

Reply #5
on: Dec 05, 2020, 8:28 PM
Sr. Member
Posts: 72 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: 368 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
Sr. Member
Posts: 72 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: 368 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

Reply #9
on: Feb 23, 2021, 8:55 AM
Sr. Member
Posts: 72 Joined: December 01, 2020

  • ***
Specific Unicode filepath support on the Windows platform has not been a project goal. Thank you for contributing.  :)

A new version is up. Now also available as a Python extension module. :)
That makes it easier to input multiple paths. ;)

Download unvivtool.exe for Windows: https://github.com/bfut/unvivtool/releases

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

Reply #10
on: Mar 02, 2021, 1:36 PM
Sr. Member
Posts: 72 Joined: December 01, 2020

  • ***
New version is up. I implemented CI on the great Github Actions, and promptly found a few things to improve.

The Python version now comes with extensive documentation & walkthrough examples, including a ready-to-go example.py script. Enjoy. :D

Reply #11
on: Mar 06, 2021, 3:12 PM
Sr. Member
Posts: 72 Joined: December 01, 2020

  • ***
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
...
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"?  :)

I looked at this and it turns out that Windows 10 actually supports UTF-8 encoded strings out of the box these days. On my Win 10 machine, I was able to open paths that contain e.g. CJK, and Cyrillic characters (and also random blanks), using unvivtool version 1.5, both CLI and Python module. Linux supports this anyway.

If this doesn't work on your Win10 system yet, some system properties may have to be set. Your feedback has been quite valuable, btw.

edit: also works with Python.

Reply #12
on: Jun 05, 2022, 5:16 AM
Hero Member
Posts: 267 Joined: June 09, 2018

  • *****
Guys, what am i doing wrong? I have Windows 7 64bit version

Reply #13
on: Jun 22, 2022, 7:05 AM
Sr. Member
Posts: 72 Joined: December 01, 2020

  • ***
Sorry for the late reply.

That output directory does not exist yet, presumably. Hence the program
ends on trying to change to a (not existing) directory. Alas, that error message
does not hint at that at all. Will be fixed, thx!

The easiest route is to extract to your current working directory
Code: [Select]
unvivtool d car.viv .

Or, first create an output directory, then run unvivtool.
Code: [Select]
mkdir mynewdirectory
unvivtool d car.viv mynewdirectory

Reply #14
on: Aug 11, 2022, 2:58 AM
Sr. Member
Posts: 72 Joined: December 01, 2020

  • ***
32-bit unvivtool.exe version 1.9 is now available from https://github.com/bfut/unvivtool

Changes:
* improved stability and usability
* documentation clarifies that paths must exist

If anyone is using unvivtool.exe on a system pre-Win 7, such as XP, 2k or even Win98, I'd love to hear your feedback. Legacy Windows systems are the main reason why this exists as an executable instead of a simple script. :)

 


Support NFSAddons: