Mint APE Loader 1.6

This change fixes a bug with loading pure bss program headers.
This commit is contained in:
Justine Tunney 2023-08-09 00:25:18 -07:00
parent c48ee8e4fe
commit 1a5ef5ba13
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
11 changed files with 87 additions and 51 deletions

View file

@ -317,7 +317,9 @@ static void showpeheader(struct NtImageNtHeaders *pe) {
printf("\n");
showpeoptionalheader(pecheckaddress(mz, mzsize, &pe->OptionalHeader,
pe->FileHeader.SizeOfOptionalHeader));
ShowSections(pecheckaddress(mz, mzsize, pe + 1,
ShowSections(pecheckaddress(mz, mzsize,
(char *)(pe + 1) +
pe->OptionalHeader.NumberOfRvaAndSizes * 8,
pe->FileHeader.NumberOfSections *
sizeof(struct NtImageSectionHeader)),
pe->FileHeader.NumberOfSections);