Skip to content

Commit 5eebe1e

Browse files
committed
fix dumping CLR modTableRows
1 parent 9d9c6f8 commit 5eebe1e

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

cmd/dump.go

+11-9
Original file line numberDiff line numberDiff line change
@@ -854,15 +854,17 @@ func parsePE(filename string, cfg config) {
854854
switch table {
855855
case peparser.Module:
856856
fmt.Print("\n\t[Modules]\n\t---------\n")
857-
modTableRow := modTable.Content.(peparser.ModuleTableRow)
858-
modName := pe.GetStringFromData(modTableRow.Name, pe.CLR.MetadataStreams["#Strings"])
859-
Mvid := pe.GetStringFromData(modTableRow.Mvid, pe.CLR.MetadataStreams["#GUID"])
860-
MvidStr := hex.EncodeToString(Mvid)
861-
fmt.Fprintf(w, "Generation:\t 0x%x\n", modTableRow.Generation)
862-
fmt.Fprintf(w, "Name:\t 0x%x (%s)\n", modTableRow.Name, string(modName))
863-
fmt.Fprintf(w, "Mvid:\t 0x%x (%s)\n", modTableRow.Mvid, MvidStr)
864-
fmt.Fprintf(w, "EncID:\t 0x%x\n", modTableRow.EncID)
865-
fmt.Fprintf(w, "EncBaseID:\t 0x%x\n", modTableRow.EncBaseID)
857+
modTableRows := modTable.Content.([]peparser.ModuleTableRow)
858+
for _, modTableRow := range modTableRows {
859+
modName := pe.GetStringFromData(modTableRow.Name, pe.CLR.MetadataStreams["#Strings"])
860+
Mvid := pe.GetStringFromData(modTableRow.Mvid, pe.CLR.MetadataStreams["#GUID"])
861+
MvidStr := hex.EncodeToString(Mvid)
862+
fmt.Fprintf(w, "Generation:\t 0x%x\n", modTableRow.Generation)
863+
fmt.Fprintf(w, "Name:\t 0x%x (%s)\n", modTableRow.Name, string(modName))
864+
fmt.Fprintf(w, "Mvid:\t 0x%x (%s)\n", modTableRow.Mvid, MvidStr)
865+
fmt.Fprintf(w, "EncID:\t 0x%x\n", modTableRow.EncID)
866+
fmt.Fprintf(w, "EncBaseID:\t 0x%x\n", modTableRow.EncBaseID)
867+
}
866868
w.Flush()
867869

868870
}

0 commit comments

Comments
 (0)