Skip to content

About

Utility for checking GoldSrc StudioModel assets and indexed-color BMP images.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

UtilAssetsIntegrity

A Windows x86 utility DLL for checking GoldSrc StudioModel assets and indexed-color BMP images. Originally part of MetaHookSv.

The initial migration preserved the original behavior. Studio validation has since been hardened; see the validation update. It preserves the CreateInterface("UtilAssetsIntegrityAPI_001", ...) interface. See 中文说明 and build details.

Build and test

Requirements: Windows, Visual Studio 2022 with the C++ desktop workload and Windows SDK, CMake 3.21 or newer, and Git. The first configure downloads pinned MetaHook SDK, FreeImage and ScopeExit sources. MetaHook's launcher and ScopeExit's examples are not built.

scripts\build-UtilAssetsIntegrity-x86-Release.bat
scripts\build-UtilAssetsIntegrity-x86-Debug.bat

Each script configures, builds, runs CTest, installs, and repeats the public-interface smoke tests against the installed DLLs. Output is under build/x86/<Configuration> and install/x86/<Configuration>. Tests dynamically load the DLL, obtain its factory, and check StudioModel and BMP behavior without running a game.

Local source trees can override automatic downloads through CMake cache arguments or environment variables. Explicit source trees are read-only inputs; CMake cache arguments take precedence. For example:

scripts\build-UtilAssetsIntegrity-x86-Release.bat "-DMETAHOOK_SOURCE_PATH=D:/MetaHookSv-org/MetaHook" "-DFREEIMAGE_SOURCE_PATH=D:/MetaHookSv/thirdparty/FreeImage" "-DSCOPEEXIT_SOURCE_PATH=D:/MetaHookSv/thirdparty/ScopeExit"

A direct CMake build can set BUILD_TESTING=OFF; the convenience scripts require tests to be enabled.

Install and use

The installed layout is:

svencoop/metahook/dlls/UtilAssetsIntegrity.dll
svencoop/metahook/dlls/UtilAssetsIntegrity.pdb
svencoop/metahook/dlls/FreeImage/FreeImage.dll   (FreeImaged.dll for Debug)

Copy the installed svencoop directory over the game's mod directory. The host must make the FreeImage directory available to the Windows DLL loader before loading UtilAssetsIntegrity.dll, as MetaHook's dependency search setup does.

Consumers include the repository's include/Interface/IUtilAssetsIntegrity.h (headers are not shipped in the release archive) plus the MetaHook SDK's interface.h, load the DLL and request UTIL_ASSETS_INTEGRITY_INTERFACE_VERSION from its CreateInterface factory. The returned instance is a singleton owned by the DLL. Keep it loaded while using the interface and do not delete the instance.

  • CheckStudioModel accepts the existing IDST/IDSQ model formats, version 10.
  • CheckStudioSequenceGroup checks an IDSQ file's animation against its main model. It accepts the last frame's interpolation read up to UTIL_ASSETS_INTEGRITY_SEQUENCE_GROUP_TAIL_BYTES past the group, as stock group files need; callers that animate the group keep that many zeroed bytes after it.
  • Check8bitBMP checks for FreeImage's indexed-color classification and applies MaxWidth, MaxHeight and MaxSize when a result object is supplied.
  • MaxSize is the decoded pixel count, not the input file size. All three limits default to zero; set them before checking a nonempty image. Passing a null result pointer skips the size limits.
  • A failed check returns a UtilAssetsIntegrityCheckReason and fills ReasonStr when a result object is supplied. The migration retains the original checks; see the project overview for their boundaries.

Builds and releases

GitHub Actions builds and tests x86 Release for main pushes, pull requests and manual runs. Tags matching v* create a release. Only the runtime svencoop/ tree from the installed directory is packaged as UtilAssetsIntegrity-windows-x86.7z, preserving its top-level directory, and verified with 7z t.

License

The module retains MetaHookSv's MIT license. Dependencies retain their own copyright and license notices in their upstream repositories, pinned in cmake/Dependencies.cmake.

About

Utility for checking GoldSrc StudioModel assets and indexed-color BMP images.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages