Skip to content

Commit

Permalink
Fix file matching by hex hash
Browse files Browse the repository at this point in the history
  • Loading branch information
xypwn committed Apr 14, 2024
1 parent 453c831 commit 7ad38c4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ func (a *App) matchFileID(id stingray.FileID, glb glob.Glob, nameOnly bool) bool
id.Name.StringEndian(binary.LittleEndian),
id.Name.StringEndian(binary.BigEndian),
"0x" + id.Name.StringEndian(binary.BigEndian),
"0x" + strings.TrimLeft(id.Name.StringEndian(binary.BigEndian), "0"),
}
if name, ok := a.Hashes[id.Name]; ok {
nameVariations = append(nameVariations, name)
Expand All @@ -209,7 +210,8 @@ func (a *App) matchFileID(id stingray.FileID, glb glob.Glob, nameOnly bool) bool
typeVariations = []string{
id.Type.StringEndian(binary.LittleEndian),
id.Type.StringEndian(binary.BigEndian),
"0x" + id.Name.StringEndian(binary.BigEndian),
"0x" + id.Type.StringEndian(binary.BigEndian),
"0x" + strings.TrimLeft(id.Type.StringEndian(binary.BigEndian), "0"),
}
if typ, ok := a.Hashes[id.Type]; ok {
typeVariations = append(typeVariations, typ)
Expand Down

0 comments on commit 7ad38c4

Please sign in to comment.