SizeOfImage fix from SoullessSentinel. Thanks.

This commit is contained in:
Echelon9 2013-05-05 11:32:15 +10:00
parent f2fd7cfbc7
commit ae824a92f6
1 changed files with 15 additions and 2 deletions

View File

@ -323,12 +323,25 @@ void Exe::Export(const char *x_szExeFilename)
goto cleanup;
}
fflush(ExeFile);
printf("OK\n");
}
}
// Write correct SizeOfImage
{
printf("Exe::Exe: Writing Image Size...\n");
int currentSize = ftell(ExeFile);
// Seek to offset of File Size
fseek(ExeFile, 0x108, SEEK_SET);
// Write calculated size
fwrite(&currentSize, sizeof(int), 1, ExeFile);
printf("OK\n");
}
fflush(ExeFile);
cleanup:
if(GetError() != 0)