GithubHelp home page GithubHelp logo

ruolinzheng08 / fasthcadecoder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kinomyu/fasthcadecoder

1.0 1.0 0.0 390 KB

Fast out-of-order HCA decoder

License: MIT License

C++ 99.86% Makefile 0.14%
decoder

fasthcadecoder's Introduction

HCA Decoder

All credits go to the original authors of the code.

This efficient, lightweight command line tool has remained in obscurity because of language barriers. To promote this tool, I translated the error messages and command line outputs, and added some useful resources like uncovered HCA keys for popular games.

Build Info and Usage

make
usage: ./clHCA [options] input.hca

options:
  -o      output filename
  -a      set key (lower 8 hex digits)
  -b      set key (higher 8 hex digits)
  -s      set sub key (4 hex digits, in decimal)
  -c      try decrypting the file without generating an output
  -m      mode
  -l      loop
  -v      volume
  -t      number of threads (to speed up decoding)
  -i      show info about input file and quit
  -h      show this help message

This repo contains a sample file sample.hca and uses its key 00A06A0B 8D0C10FD as a built-in. Note that you have to change the key for your HCA files to decode properly. You can find a list of uncovered HCA keys for popular games here:

Note that the lower digits 8D0C10FD go with -a and the higher ones 00A06A0B go with -b.

Decode

./clHCA sample.hca -a 8D0C10FD -b 00A06A0B

sample.hca will decode to sample.wav. You should hear footsteps if you play it. If you hear noise instead, please submit a GitHub issue.

Decrypt (no output)

./clHCA sample.hca -a 8D0C10FD -b 00A06A0B -c

Decrypting sample.hca...
Decrypted successfully with the keys provided.

HCA file Info

The ouput below shows that our sample file uses enrcyption keys.

./clHCA sample.hca -i

Showing info for sample.hca:
Codec: HCA
version: 2.0
Channel count: stereo (2 channels)
Sampling rate: 48000Hz
Block count: 393
Mute header sample count: 0
Mute footer sample count: 943
Bit rate: 192kbps CBR (default bit rate)
Block size: 0x200
comp1: 1
comp2: 15
comp3: 1
comp4: 0
comp5: 128
comp6: 64
comp7: 64
comp8: 0
Cipher type: Key cipher ※If you do not use the correct key, the output waveform will be incorrect.

Another sample file can be found at: https://kinomyu.github.io/bgm.hca. Note that there is no encrytion key.

./clHCA bgm.hca -i

Showing info for bgm.hca:
Codec: HCA
version: 2.0
Channel count: stereo (2 channels)
Sampling rate: 44100Hz
Block count: 5563
Mute header sample count: 0
Mute footer sample count: 164
Bit rate: 234.97kbps CBR (default bit rate)
Block size: 0x2AA
comp1: 1
comp2: 15
comp3: 1
comp4: 0
comp5: 128
comp6: 128
comp7: 0
comp8: 0
Cipher type: None

fasthcadecoder's People

Contributors

kinomyu avatar nyagamon avatar ruolinzheng08 avatar wx257osn2 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.