|
@@ -56,8 +56,9 @@ const WiseScriptParseState *getWiseScriptState(void)
|
|
|
|
|
|
REWError readWiseScriptHeader(FILE *fp, WiseScriptHeader *header) {
|
|
|
// init struct
|
|
|
+ header->url = NULL;
|
|
|
header->logPath = NULL;
|
|
|
- header->font = NULL;
|
|
|
+ header->font = NULL;
|
|
|
|
|
|
REWError status;
|
|
|
|
|
@@ -91,12 +92,18 @@ REWError readWiseScriptHeader(FILE *fp, WiseScriptHeader *header) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- // Read 23 unknown bytes
|
|
|
- if ((status = readBytesInto(fp, header->unknown_23, 23)) != REWERR_OK) {
|
|
|
- printError("Failed to read 23 unknown bytes\n");
|
|
|
+ // Read 22 unknown bytes
|
|
|
+ if ((status = readBytesInto(fp, header->unknown_22, 22)) != REWERR_OK) {
|
|
|
+ printError("Failed to read 22 unknown bytes\n");
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ status = readCString(fp, &header->url);
|
|
|
+ if (status != REWERR_OK) {
|
|
|
+ printError("Failed to read WiseScriptHeader url: %d\n", status);
|
|
|
+ return status;
|
|
|
+ }
|
|
|
+
|
|
|
status = readCString(fp, &header->logPath);
|
|
|
if (status != REWERR_OK) {
|
|
|
printError("Failed to read WiseScriptHeader logpath: %d\n", status);
|
|
@@ -902,6 +909,10 @@ REWError readWiseScriptUnknown0x30(FILE *fp, WiseScriptUnknown0x30 *data)
|
|
|
|
|
|
|
|
|
void freeWiseScriptHeader(WiseScriptHeader * header) {
|
|
|
+ if (header->url != NULL) {
|
|
|
+ free(header->url);
|
|
|
+ header->url = NULL;
|
|
|
+ }
|
|
|
if (header->logPath != NULL) {
|
|
|
free(header->logPath);
|
|
|
header->logPath = NULL;
|
|
@@ -1243,16 +1254,16 @@ void printWiseScriptHeader(WiseScriptHeader * header) {
|
|
|
|
|
|
printf("datetime : 0x%08X (%u)\n", header->datetime, header->datetime);
|
|
|
|
|
|
- printf("unknown_23 : ");
|
|
|
- for (int i = 0; i < 23; i++) {
|
|
|
- printf("%02X ", header->unknown_23[i]);
|
|
|
+ printf("unknown_22 : ");
|
|
|
+ for (int i = 0; i < 22; i++) {
|
|
|
+ printf("%02X ", header->unknown_22[i]);
|
|
|
}
|
|
|
printf("\n");
|
|
|
|
|
|
-
|
|
|
- printf("'%s': '%s'\n", header->font, header->logPath);
|
|
|
+ printf("header->url : '%s'\n", header->url);
|
|
|
+ printf("header->font : '%s'\n", header->font);
|
|
|
+ printf("header->logPath: '%s'\n", header->logPath);
|
|
|
printf("-----------------\n");
|
|
|
-
|
|
|
}
|
|
|
|
|
|
void printWiseScriptLanguages(CStrings *languages)
|