lib.rs 902 B

12345678910111213141516171819202122232425
  1. //! Everything specific to Grand Theft Auto VI: its container formats, build
  2. //! identities, and the hooks we place in its code (located by per-build
  3. //! offsets or byte-pattern signatures). What may and may not be stored here
  4. //! is defined in docs/asset-policy.md.
  5. pub mod sgd5;
  6. /// A specific build of the Grand Theft Auto VI executable we know how to run.
  7. #[derive(Debug, Clone, Copy)]
  8. pub struct KnownBuild {
  9. /// Our own label, e.g. "1.0.0 retail".
  10. pub label: &'static str,
  11. /// BLAKE3 of the original executable, hex.
  12. pub blake3: &'static str,
  13. }
  14. /// Builds we support. Empty until the executable is available.
  15. pub const KNOWN_BUILDS: &[KnownBuild] = &[];
  16. /// Looks up a build by the BLAKE3 hash of its executable.
  17. pub fn identify(blake3_hex: &str) -> Option<&'static KnownBuild> {
  18. KNOWN_BUILDS
  19. .iter()
  20. .find(|b| b.blake3.eq_ignore_ascii_case(blake3_hex))
  21. }