@@ -30,7 +30,7 @@ func readExports(virtualAddress uint32) {
3030 err = binary .Read (reader , binary .LittleEndian , & exportDirectory )
3131
3232 if err != nil {
33- fmt .Println ("Impossibile leggere la struttura exportDirectory" )
33+ fmt .Println ("Impossibile leggere la struttura exportDirectory " + err . Error () )
3434 }
3535
3636 namesTableRVA := exportDirectory .NameRva - section .VirtualAddress
@@ -47,12 +47,14 @@ func readExports(virtualAddress uint32) {
4747 _ , err = reader .Seek (int64 (namesTableRVA + uint32 (i * 4 )), io .SeekStart )
4848 if err != nil {
4949 fmt .Println ("Errore nel seek per la tabella delle funzioni esportate" )
50+ return
5051 }
5152
5253 exportAddressTable := ExportAddressTable {}
5354 err = binary .Read (reader , binary .LittleEndian , & exportAddressTable )
5455 if err != nil {
5556 fmt .Println ("Impossibile leggere la struttura ExportAddressTable per il seguente motivo : " + err .Error ())
57+ return
5658 }
5759
5860 name := utils .ReadString (section .Raw [exportAddressTable .ExportRva - section .VirtualAddress :])
@@ -61,12 +63,17 @@ func readExports(virtualAddress uint32) {
6163
6264 if err != nil {
6365 fmt .Println ("Impossibile eseguire il seek per la lettura della prossima riga." )
66+ return
6467 }
6568
6669 exportOrdinalTable := ExportAddressTable {}
6770 err = binary .Read (reader , binary .LittleEndian , & exportOrdinalTable )
71+ if err != nil {
72+ fmt .Println ("Impossibile leggere la struttura ExportAddressTable per il seguente motivo: " + err .Error ())
73+ return
74+ }
6875 rva := exportOrdinalTable .ExportRva
69-
76+
7077 export := & Export {name , ordinal + uint16 (exportDirectory .OrdinalBase ), rva }
7178 fileAnalyzed .Exports = append (fileAnalyzed .Exports , export )
7279 fileAnalyzed .ExportNameMap [name ] = export
0 commit comments