diff -ubr fasdump/fasdump.c fasdump-mario/fasdump.c --- fasdump/fasdump.c 2009-04-04 22:35:19.000000000 +0200 +++ fasdump-mario/fasdump.c 2015-10-28 16:53:16.977631785 +0100 @@ -22,7 +22,7 @@ /* convert pascal string to C string. parameters: pointers to pascal and C string (must be large enough) */ -void pstr2cstr(const char *pstr, char *cstr) +void pstr2cstr(const uint8_t *pstr, char *cstr) { /* first byte of pascal string contains string length */ uint8_t len = (uint8_t)(*pstr); @@ -61,7 +61,7 @@ fprintf(stderr, "Read error while processing header\n"); goto out_error; } - if (hdr.signature != 0x1B736166) { + if (hdr.signature != 0x1A736166) { fprintf(stderr, "File is corrupt, signature is invalid\n"); goto out_error; } @@ -95,7 +95,7 @@ } /* read preprocessed source. on error, free all allocated memory */ - psrc = (char *)malloc(hdr.psrc_len); + psrc = (uint8_t *)malloc(hdr.psrc_len); if (psrc == NULL) { fprintf(stderr, "Memory allocation error while processing" " preprocessed source\n"); @@ -279,12 +279,12 @@ /* print preprocessed source */ void print_preproc_src() { - char *token_line; /* token line (dynamically allocated) */ - char *tmp_tl; /* temp for token_line during realloc */ + uint8_t *token_line; /* token line (dynamically allocated) */ + uint8_t *tmp_tl; /* temp for token_line during realloc */ uint32_t cur_line_len; /* current length of token line */ uint32_t calc_line_len; /* calculated length of token line */ uint32_t idx; /* index into token_line */ - char *token_ptr; /* points to token */ + uint8_t *token_ptr; /* points to token */ uint32_t token_len; /* length of token */ uint8_t test_byte; int just_did_token; @@ -293,7 +293,7 @@ /* allocate a default buffer. if it later turns out that this is not big enough (there's no limit to token line length), it will be expanded */ cur_line_len = 1024; - token_line = (char *)malloc(cur_line_len); + token_line = (uint8_t *)malloc(cur_line_len); if (token_line == NULL) { fprintf(stderr, "Memory allocation error\n"); goto out_error; @@ -332,7 +332,7 @@ /* buffer too small for token line? expand it */ if (calc_line_len > cur_line_len) { cur_line_len += 4096; - tmp_tl = (char *)xrealloc(token_line, + tmp_tl = (uint8_t *)xrealloc(token_line, cur_line_len); if (tmp_tl == NULL) { goto out_error_free; @@ -374,7 +374,7 @@ /* buffer too small for token line? expand it */ if (calc_line_len > cur_line_len) { cur_line_len += 4096; - tmp_tl = (char *)xrealloc(token_line, + tmp_tl = (uint8_t *)xrealloc(token_line, cur_line_len); if (tmp_tl == NULL) { goto out_error_free; @@ -388,7 +388,7 @@ } /* print line (if it's not empty) */ token_line[idx] = '\0'; - if (strlen(token_line) > 0) { + if (strlen((char*)token_line) > 0) { printf("%s\n", token_line); } } diff -ubr fasdump/fasdump.h fasdump-mario/fasdump.h --- fasdump/fasdump.h 2009-04-04 22:35:23.000000000 +0200 +++ fasdump-mario/fasdump.h 2015-10-28 16:52:24.037629370 +0100 @@ -67,14 +67,14 @@ char *strtbl; /* string table */ struct symtbl_entry *symtbl; /* symbol table */ uint32_t num_symbols; /* number of symbols */ -char *psrc; /* char* so it's easier to parse token sequences. +uint8_t *psrc; /* char* so it's easier to parse token sequences. overlay struct psrc_ln_fixed at start. */ uint32_t *scttbl; /* section names table */ uint32_t num_sections; /* number of sections */ /* prototypes */ void *xrealloc(void *, const size_t); -void pstr2cstr(const char *, char *); +void pstr2cstr(const uint8_t* pstr, char* cstr); void print_usage(FILE *, const char *, const int); int read_all_file_parts(FILE *); void print_header(void); Only in fasdump-mario/: Makefile