Hagrid is a tool to manage the extraction of the game files for Harry Potter and the Philosopher's Stone and Harry Potter and the Chamber of Secrets for the Playstation One
It handles handles extracting and repacking the .dat/.dir files used by the game, where .dat contains unencrypted files and .dir lists the .dat file contents.
To extract a .dat/.dir file pair:
hagrid dat-dir --mode extract --dat-file <file.dat> --dir-file <file.dir> --path <output_path>
To repack an extracted .dat/.dir pair:
hagrid dat-dir --mode pack --dat-file <out.dat> --dir-file <out.dir> --path <extracted_dir_path>
For information on extracting the .bin and .cue files from the game to view the file contents, as well as format info, please see my original blog post on the C version this tool.