From 152ed9baaaf87e7741960878d024454c43d20e24 Mon Sep 17 00:00:00 2001 From: Mikhail Gusarov Date: Wed, 17 Oct 2018 17:36:06 +0200 Subject: [PATCH] goversion: look up module table in .rdata under Windows Fixes #7. --- version/exe.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/version/exe.go b/version/exe.go index dc87129..f3f56c9 100644 --- a/version/exe.go +++ b/version/exe.go @@ -227,7 +227,12 @@ func (x *peExe) TextRange() (uint64, uint64) { } func (x *peExe) RODataRange() (uint64, uint64) { - return x.TextRange() + for _, sect := range x.f.Sections { + if sect.Name == ".rdata" { + return uint64(sect.VirtualAddress) + x.imageBase(), uint64(sect.VirtualAddress+sect.Size) + x.imageBase() + } + } + return 0, 0 } type machoExe struct {