Merge pull request #1556 from ergo720/fix_xbe_loading_size_zero

Fix xbe loading when section filesize is zero
This commit is contained in:
RadWolfie 2019-03-02 12:42:56 -06:00 committed by GitHub
commit e099b0b129
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;