From 186c12145c43220cf0a02af1523a272a7108799c Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sat, 5 Jul 2025 20:39:44 +0200 Subject: [PATCH] Implemented a minimum length for sections --- src/exe/Executable.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/exe/Executable.go b/src/exe/Executable.go index b0c6fa0..2d53a5c 100644 --- a/src/exe/Executable.go +++ b/src/exe/Executable.go @@ -19,8 +19,12 @@ func New(headerEnd int, fileAlign int, memoryAlign int, congruent bool, raw ...[ congruent: congruent, } - for i, data := range raw { - exe.Sections[i] = &Section{Bytes: data} + for i, section := range raw { + if len(section) == 0 { + section = []byte{0} + } + + exe.Sections[i] = &Section{Bytes: section} } exe.Update()