diff --git a/src/meta/ktsr.c b/src/meta/ktsr.c index 5836a1f2..dcc354af 100644 --- a/src/meta/ktsr.c +++ b/src/meta/ktsr.c @@ -480,7 +480,8 @@ fail: return 0; } -/* ktsr engine reads+decrypts in the same func based on passed flag tho (reversed from exe) */ +/* ktsr engine reads+decrypts in the same func based on passed flag tho (reversed from exe) + * Strings are usually ASCII but Shift-JIS is used in rare cases (0x0c3e2edf.srsa) */ static void decrypt_string_ktsr(char* buf, size_t buf_size, uint32_t seed) { for (int i = 0; i < buf_size - 1; i++) { if (!buf[i]) /* just in case */ diff --git a/src/util/log.h b/src/util/log.h index b94641c3..2396b9aa 100644 --- a/src/util/log.h +++ b/src/util/log.h @@ -67,7 +67,7 @@ void vgm_log_set_callback(void* ctx_p, int level, int type, void* callback); do { \ int i; \ for (i=0; i < buf_size; i++) { \ - printf("%02x",buf[i]); \ + printf("%02x",buf[i] & 0xFF); \ if (bytes_per_line && (i+1) % bytes_per_line == 0) printf("\n"); \ } \ printf("\n"); \