Implemented dynamic section alignment

This commit is contained in:
2025-03-09 00:23:23 +01:00
parent b67f3b0977
commit 947a8db937
9 changed files with 35 additions and 23 deletions

View File

@ -73,8 +73,8 @@ func Write(writer io.Writer, codeBytes []byte, dataBytes []byte, dlls dll.List)
AddressOfEntryPoint: uint32(code.MemoryOffset),
BaseOfCode: uint32(code.MemoryOffset),
ImageBase: config.BaseAddress,
SectionAlignment: config.MemoryAlign, // power of 2, must be greater than or equal to FileAlignment
FileAlignment: config.FileAlign, // power of 2
SectionAlignment: uint32(config.MemoryAlign), // power of 2, must be greater than or equal to FileAlignment
FileAlignment: uint32(config.FileAlign), // power of 2
MajorOperatingSystemVersion: 0x06,
MinorOperatingSystemVersion: 0,
MajorImageVersion: 0,