Skip to content

Commit

Permalink
Ignore unrecognized options and guess ps2 types
Browse files Browse the repository at this point in the history
  • Loading branch information
heinermann committed Mar 10, 2024
1 parent 472e7fd commit 76f19d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions BOLT/bolt-extract/guess_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ bool is_audio_file(const std::vector<std::byte>& data) {
return true;
}

bool is_vag_file(const std::vector<std::byte>& data) {
return check_easy_header(data, 'V', 'A', 'G', 'p');
}

bool is_elf_file(const std::vector<std::byte>& data) {
return check_easy_header(data, 0x7F, 'E', 'L', 'F');
}

std::string guess_extension(const std::vector<std::byte>& data) {
if (data.size() != 0) {
if (is_wav_file(data)) return ".wav";
Expand All @@ -186,6 +194,8 @@ std::string guess_extension(const std::vector<std::byte>& data) {
if (is_tbl_file(data)) return ".tbl";
if (is_grp_file(data)) return ".grp";
if (is_txt_file(data)) return ".txt";
if (is_vag_file(data)) return ".vag";
if (is_elf_file(data)) return ".elf";
}
return ".unk";
}
1 change: 1 addition & 0 deletions BOLT/bolt-extract/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ void configure(cxxopts::Options& cmd) {

cmd.parse_positional({ "input", "output" });
cmd.positional_help("INPUT_FILE [OUTPUT_DIR]");
cmd.allow_unrecognised_options();
}

void show_help(cxxopts::Options &cmd) {
Expand Down

0 comments on commit 76f19d8

Please sign in to comment.