Fix xbe loading when section filesize is zero

This commit is contained in:
ergo720 2019-03-02 19:05:46 +01:00
parent 9c4836f6c0
commit a69553c1b6
1 changed files with 6 additions and 2 deletions

View File

@ -737,9 +737,13 @@ void *Xbe::FindSection(char *zsSectionName)
void* Xbe::FindSection(xboxkrnl::PXBEIMAGE_SECTION section)
{
for (uint32 v = 0; v < m_Header.dwSections; v++) {
if (m_SectionHeader[v].dwRawAddr == section->FileAddress && (m_SectionHeader[v].dwVirtualAddr > 0 && m_SectionHeader[v].dwVirtualSize > 0)) {
return m_bzSection[v];
if (m_SectionHeader[v].dwVirtualAddr > 0 && m_SectionHeader[v].dwVirtualSize > 0) {
if (m_SectionHeader[v].dwRawAddr == section->FileAddress && m_SectionHeader[v].dwVirtualAddr == (uint32)(section->VirtualAddress)
&& m_SectionHeader[v].dwVirtualSize == section->VirtualSize) {
return m_bzSection[v];
}
}
}
return NULL;