From 596ad79acf38b8538a503ece4d2145fd813172f8 Mon Sep 17 00:00:00 2001 From: RamiLego4Game Date: Sun, 13 May 2018 14:24:53 +0300 Subject: [PATCH] Bugfix sections table writing --- love-pe.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/love-pe.lua b/love-pe.lua index b9f40d2..4119226 100644 --- a/love-pe.lua +++ b/love-pe.lua @@ -515,16 +515,16 @@ end local function writeSectionsTable(exeFile,Sections) for id, Section in ipairs(Sections) do - exeFile:write(Section.Name.."\0") - exeFile:write(encodeNumber(Section.VirtualSize,4,true)) - exeFile:write(encodeNumber(Section.VirtualAddress,4,true)) - exeFile:write(encodeNumber(Section.SizeOfRawData,4,true)) - exeFile:write(encodeNumber(Section.PointerToRawData,4,true)) - exeFile:write(encodeNumber(Section.PointerToRelocations,4,true)) - exeFile:write(encodeNumber(Section.PointerToLinenumbers,4,true)) - exeFile:write(encodeNumber(Section.NumberOfRelocations,2,true)) - exeFile:write(encodeNumber(Section.NumberOfLinenumbers,2,true)) - exeFile:write(encodeNumber(Section.Characteristics,4,true)) + exeFile:write(Section.Name..string.rep("\0",8-#Section.Name)) + exeFile:write(encodeNumber(Section.VirtualSize,4,false)) + exeFile:write(encodeNumber(Section.VirtualAddress,4,false)) + exeFile:write(encodeNumber(Section.SizeOfRawData,4,false)) + exeFile:write(encodeNumber(Section.PointerToRawData,4,false)) + exeFile:write(encodeNumber(Section.PointerToRelocations,4,false)) + exeFile:write(encodeNumber(Section.PointerToLinenumbers,4,false)) + exeFile:write(encodeNumber(Section.NumberOfRelocations,2,false)) + exeFile:write(encodeNumber(Section.NumberOfLinenumbers,2,false)) + exeFile:write(encodeNumber(Section.Characteristics,4,false)) end end