Skip to content

Commit

Permalink
Update syms.go
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Jul 3, 2024
1 parent e8007b2 commit e6d67d9
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions internal/syms/syms.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,25 +186,29 @@ func Scan(ipswPath string, db db.Database) (err error) {
ipsw.Devices = append(ipsw.Devices, &model.Device{
Name: dev,
})
if err := db.Save(ipsw); err != nil {
return fmt.Errorf("failed to save IPSW to database: %w", err)
}
}
if err := db.Save(ipsw); err != nil {
return fmt.Errorf("failed to save IPSW to database: %w", err)
}

/* KERNEL */
if ipsw.Kernels, err = scanKernels(ipswPath); err != nil {
return fmt.Errorf("failed to scan kernels: %w", err)
}
log.Debug("Saving IPSW with Kernels")
db.Save(ipsw)
if err := db.Save(ipsw); err != nil {
return fmt.Errorf("failed to save IPSW to database: %w", err)
}

/* DSC */
ipsw.DSCs, err = scanDSCs(ipswPath)
if err != nil {
return fmt.Errorf("failed to scan DSCs: %w", err)
}
log.Debug("Saving IPSW with DSCs")
db.Save(ipsw)
if err := db.Save(ipsw); err != nil {
return fmt.Errorf("failed to save IPSW to database: %w", err)
}

/* FileSystem */
if err := search.ForEachMachoInIPSW(ipswPath, func(path string, m *macho.File) error {
Expand Down Expand Up @@ -239,8 +243,7 @@ func Scan(ipswPath string, db db.Database) (err error) {
}); err != nil {
return fmt.Errorf("failed to search for machos in IPSW: %w", err)
}
log.Debug("Saving IPSW with FileSystem")
db.Save(ipsw)

return nil
log.Debug("Saving IPSW with FileSystem")
return db.Save(ipsw)
}

0 comments on commit e6d67d9

Please sign in to comment.