@@ -88,10 +88,10 @@ func printFileReport(file entity.File, webSvc webapi.Service) {
8888 printKV ("Packer" , strings .Join (file .Packer , ", " ))
8989 }
9090 if file .IsArchive {
91- printKV ("Archive" , fmt .Sprintf ("yes (%d files)" , len (file .ArchiveFiles )))
91+ printKV ("Archive" , fmt .Sprintf ("yes (%d files)" , len (file .DerivedFiles )))
9292 }
93- if file .ArchiveSHA256 != "" {
94- printKV ("Parent" , file .ArchiveSHA256 )
93+ if file .ParentSHA256 != "" {
94+ printKV ("Parent" , file .ParentSHA256 )
9595 }
9696 if file .FirstSeen != 0 {
9797 printKV ("First Seen" , formatTimestamp (file .FirstSeen ))
@@ -103,8 +103,8 @@ func printFileReport(file entity.File, webSvc webapi.Service) {
103103
104104 if file .IsArchive {
105105 // Archives only scan their children, skip verdict and AV results.
106- if len (file .ArchiveFiles ) > 0 {
107- printArchiveChildren (file .ArchiveFiles , webSvc )
106+ if len (file .DerivedFiles ) > 0 {
107+ printArchiveChildren (file .DerivedFiles , webSvc )
108108 }
109109 } else {
110110 // Classification.
@@ -122,6 +122,7 @@ type childSummary struct {
122122 sha256 string
123123 classification string
124124 format string
125+ size int64
125126 positives int
126127 enginesCount int
127128 err error
@@ -136,6 +137,7 @@ func fetchChildSummary(sha256 string, webSvc webapi.Service) childSummary {
136137 sha256 : sha256 ,
137138 classification : file .Classification ,
138139 format : file .Format ,
140+ size : file .Size ,
139141 }
140142 if file .Extension != "" {
141143 cs .format += "/" + file .Extension
@@ -153,28 +155,30 @@ func fetchChildSummary(sha256 string, webSvc webapi.Service) childSummary {
153155 return cs
154156}
155157
156- func printArchiveChildren (archiveFiles []string , webSvc webapi.Service ) {
157- fmt .Println (headerStyle .Render (fmt .Sprintf ("Archive Contents (%d files)" , len (archiveFiles ))))
158+ func printArchiveChildren (derivedFiles []entity. DerivedFile , webSvc webapi.Service ) {
159+ fmt .Println (headerStyle .Render (fmt .Sprintf ("Archive Contents (%d files)" , len (derivedFiles ))))
158160 fmt .Println ()
159161
160162 // Table header.
161163 fmtCol := lipgloss .NewStyle ().Width (16 )
164+ sizeCol := lipgloss .NewStyle ().Width (10 )
162165 avCol := lipgloss .NewStyle ().Width (14 )
163166 clsCol := lipgloss .NewStyle ().Width (12 )
164167
165- fmt .Printf (" %s %s %s %s\n " ,
168+ fmt .Printf (" %s %s %s %s %s \n " ,
166169 styleDim .Render (fmt .Sprintf ("%-64s" , "SHA256" )),
167170 styleDim .Render (fmtCol .Render ("FORMAT" )),
171+ styleDim .Render (sizeCol .Render ("SIZE" )),
168172 styleDim .Render (avCol .Render ("DETECTIONS" )),
169173 styleDim .Render (clsCol .Render ("VERDICT" )),
170174 )
171- fmt .Printf (" %s\n " , styleDim .Render (strings .Repeat ("─" , 108 )))
175+ fmt .Printf (" %s\n " , styleDim .Render (strings .Repeat ("─" , 119 )))
172176
173- for _ , sha := range archiveFiles {
174- cs := fetchChildSummary (sha , webSvc )
177+ for _ , df := range derivedFiles {
178+ cs := fetchChildSummary (df . SHA256 , webSvc )
175179 if cs .err != nil {
176180 fmt .Printf (" %s %s\n " ,
177- sha ,
181+ df . SHA256 ,
178182 styleError .Render ("error: " + cs .err .Error ()),
179183 )
180184 continue
@@ -187,9 +191,10 @@ func printArchiveChildren(archiveFiles []string, webSvc webapi.Service) {
187191 detStr = cleanStyle .Render (detStr )
188192 }
189193
190- fmt .Printf (" %s %s %s %s\n " ,
194+ fmt .Printf (" %s %s %s %s %s \n " ,
191195 cs .sha256 ,
192196 fmtCol .Render (cs .format ),
197+ sizeCol .Render (formatSize (cs .size )),
193198 avCol .Render (detStr ),
194199 clsCol .Render (renderClassification (cs .classification )),
195200 )
0 commit comments