Fix relocation data directory corruption

This commit is contained in:
RamiLego4Game
2018-05-16 19:05:40 +03:00
parent ee51da4a73
commit 75bed3c9dc

View File

@@ -780,12 +780,6 @@ function icapi.replaceIcon(exeFile,icoFile,newFile)
end end
end end
for id, Directory in ipairs(DataDirectories) do
if Directory[1] > Sections[RSRC_ID].VirtualAddress then
Directory[1] = Directory[1] + ShiftOffset
end
end
--Copy the DOS,PE,COFF and PEOpt headers --Copy the DOS,PE,COFF and PEOpt headers
exeFile:seek(0) exeFile:seek(0)
newFile:write(exeFile:read(DataDirectoriesOffset)) newFile:write(exeFile:read(DataDirectoriesOffset))