Implemented dynamic section alignment

This commit is contained in:
Eduard Urbach 2025-03-09 00:23:23 +01:00
parent 4faab9606c
commit c010a81ac6
Signed by: eduard
GPG key ID: 49226B848C78F6C8
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,