Skip to content

Original names of icons #2

Description

@Firemoon777

Hello.

Thanks for your solution. I used it for extracting weapon icons for my pet project.

Unfortunaly, I didn't figure out how to match icon id with weapon_id or something simmilar. But I founded that SWF contains original names and it can be parsed from swfdump -u iconlib.swf output. For example:

$ swfdump -u iconlib.swf | grep exports | grep icon | grep ak47
                exports 0196 as "icon-ak47_grey.png"
                exports 0197 as "icon-ak47.png"
                exports 0304 as "icon-ak47"
                exports 0569 as "outline-icon-ak47"

I've created a shell script, which renames extracted files to its original name. Here it is:

#!/bin/bash

IFS='
'

for line in $(swfdump -u iconlib.swf | grep exports); do
        id=$(echo $line | awk '{print$2}'  | sed -e 's/^[0]*//')
        name=$(echo $line | awk '{print$4}' | sed -e 's/"//g')

        if [[ -f csgo-icons/$id.png ]]; then
                mv csgo-icons/$id.png csgo-icons/$name
        fi
done

It hardcodes file format to png (actually all images appears to be png, even with jpg extenstion), but it solved my problem. Maybe it would be usefull for improvement of your programm.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions