Skip to content

Commit

Permalink
gust_enc: fix NOA/NOA2 regression
Browse files Browse the repository at this point in the history
Decoding fails with "Unexpected footer value: 0x000000ff".
  • Loading branch information
VitaSmith committed Aug 8, 2020
1 parent 0dd95e9 commit bfcf2fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
A set of commandline utilities designed to work with Gust (Koei/Tecmo) PC game assets such as the ones from
[_Atelier series_](https://store.steampowered.com/search/?sort_by=Name_ASC&term=atelier&tags=122&category1=998),
[_Nights of Azure series_](https://store.steampowered.com/search/?term=%22nights%20of%20azure%22&category1=998),
[_Blue Reflection_](https://store.steampowered.com/app/658260/BLUE_REFLECTION__BLUE_REFLECTION/), ...
[_Blue Reflection_](https://store.steampowered.com/app/658260/BLUE_REFLECTION__BLUE_REFLECTION/),
[_Fairy Tail_](https://store.steampowered.com/app/1233260/FAIRY_TAIL/), ...

Utilities
=========
Expand Down
4 changes: 2 additions & 2 deletions gust_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,8 @@ static uint32_t unscramble(uint8_t* payload, uint32_t payload_size, seed_data* s
// Read the descrambled checksums footer (16 bytes)
uint32_t* footer = (uint32_t*)&payload[payload_size - E_FOOTER_SIZE];
payload_size -= E_FOOTER_SIZE;
if ((getdata32(footer) != 0) && (getdata32(footer) != 0x000000ff)) {
fprintf(stderr, "ERROR: Unexpected footer value: 0x%08x\n", footer[0]);
if ((getdata32(footer) != 0) && (getdata32(footer) != 0x000000ff) && (getdata32(footer) != 0xff000000)) {
fprintf(stderr, "ERROR: Unexpected footer value: 0x%08x\n", getdata32(footer));
return 0;
}
// The 3rd checksum is probably leftover from the compression algorithm used
Expand Down

0 comments on commit bfcf2fe

Please sign in to comment.