glacier-modding / RPKG-Tool

The RPKG tool allows for easy (un)packing of files from the Glacier Engine RPKG file format! Hitman 3 has the most support.
https://glaciermodding.org/rpkg/
Other
47 stars 9 forks source link

[RPKG] Change hash_value in meta JSON to an IOI path #85

Closed AnthonyFuller closed 1 year ago

AnthonyFuller commented 1 year ago

As title:

Before:

{
    "hash_value": "000804A6A00A1A45",
    "hash_offset": 200086824,
    "hash_size": 2147484153,
    "hash_resource_type": "ATMD",
    "hash_reference_table_size": 31,
    "hash_reference_table_dummy": 0,
    "hash_size_final": 973,
    "hash_size_in_memory": 4294967295,
    "hash_size_in_video_memory": 4294967295,
    "hash_reference_data": [
        {
            "hash": "[assembly:/sound/wwise/exportedwwisedata/events/animation/foley/environment_interactions/newspaper/play_fol_newspaper_open_hero.wwiseevent].pc_wwisebank",
            "flag": "5F"
        },
        {
            "hash": "[assembly:/sound/wwise/exportedwwisedata/events/animation/foley/environment_interactions/newspaper/play_fol_newspaper_pickup_hero.wwiseevent].pc_wwisebank",
            "flag": "5F"
        },
        {
            "hash": "[assembly:/sound/wwise/exportedwwisedata/events/animation/foley/genericfoley/anim_genfoley_flap.wwiseevent].pc_wwisebank",
            "flag": "5F"
        }
    ]
}

After:

{
    "hash_value": "[assembly:/animations/hitman01/movement/020_miscellaneous/007_disguise/hm_disguise_hips_sit_reading_newspaper.amd?/hm_disguise_hips_sit_reading_newspaper_start.atmd].pc_atmd",
    "hash_offset": 200086824,
    "hash_size": 2147484153,
    "hash_resource_type": "ATMD",
    "hash_reference_table_size": 31,
    "hash_reference_table_dummy": 0,
    "hash_size_final": 973,
    "hash_size_in_memory": 4294967295,
    "hash_size_in_video_memory": 4294967295,
    "hash_reference_data": [
        {
            "hash": "[assembly:/sound/wwise/exportedwwisedata/events/animation/foley/environment_interactions/newspaper/play_fol_newspaper_open_hero.wwiseevent].pc_wwisebank",
            "flag": "5F"
        },
        {
            "hash": "[assembly:/sound/wwise/exportedwwisedata/events/animation/foley/environment_interactions/newspaper/play_fol_newspaper_pickup_hero.wwiseevent].pc_wwisebank",
            "flag": "5F"
        },
        {
            "hash": "[assembly:/sound/wwise/exportedwwisedata/events/animation/foley/genericfoley/anim_genfoley_flap.wwiseevent].pc_wwisebank",
            "flag": "5F"
        }
    ]
}
Notexe commented 1 year ago

Does this work fine for resources that have no known paths?

github-actions[bot] commented 1 year ago

Download the artifacts for this pull request:

AnthonyFuller commented 1 year ago

Does this work fine for resources that have no known paths?

Yes. It uses the same function as the ASVA JSON function for example.

If it's unknown for meta -> json then it will just be 00XXXXXXXXXXXXXX. If it's not 00XXXXXXXXXXXXXX (or just not a number), for json -> meta, it will hash it.

The ASVA -> JSON function checks to see if [ is in the string to decide if it should hash the string, I feel this isn't really the best option for it as if someone just puts a string in it there e.g. my_new_file, it won't be hashed. Which of course, isn't best practice from the user, but it's artificially limiting. The ASVA -> JSON function, if the "ASVA" value is not a valid number or contains [ will give a hash value of 0, producing this: image

Which is far from ideal, this should be revised.

AnthonyFuller commented 1 year ago

Hash meta JSON files now check for [ at the start of the hash_value like dependencies before hashing.

RDIL commented 1 year ago

Which is far from ideal, this should be revised.

I honestly think that applies to the entirety of this program.