We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After parsing an object file, I get an invalid ArchiveHeader.Data field with garbage at the end. The ArchiveHeader.Size field is also set incorrectly.
ArchiveHeader.Data
ArchiveHeader.Size
package main import ( "fmt" "github.com/Binject/debug/goobj2" ) func main() { const magicHeaderName = "magic/example" magicData := make([]byte, 256) original, err := goobj2.Parse("a.obj", "main", nil) if err != nil { panic(err) } original.ArchiveMembers = append(original.ArchiveMembers, goobj2.ArchiveMember{ ArchiveHeader: goobj2.ArchiveHeader{ Name: magicHeaderName, Size: int64(len(magicData)), Data: magicData, }, }) if err := original.Write("b.obj"); err != nil { panic(err) } patched, err := goobj2.Parse("b.obj", "main", nil) if err != nil { panic(err) } var magicArchive goobj2.ArchiveMember for _, member := range patched.ArchiveMembers { if member.ArchiveHeader.Name == magicHeaderName { magicArchive = member break } } if magicArchive.ArchiveHeader.Size != int64(len(magicData)) { panic(fmt.Sprintf("real size %d != parsed size %d", magicArchive.ArchiveHeader.Size, len(magicData))) } }
panic: real size 348 != parsed size 256
The text was updated successfully, but these errors were encountered:
cc437dc
IsDataObj generates incorrect object files. I add IsDataObj=true here and get error "corrupt archive": https://github.com/Binject/debug/blob/master/goobj2/file.go#L509
IsDataObj
IsDataObj=true
Object file: pkg.zip
Sorry, something went wrong.
No branches or pull requests
After parsing an object file, I get an invalid
ArchiveHeader.Data
field with garbage at the end. TheArchiveHeader.Size
field is also set incorrectly.Code:
Output:
The text was updated successfully, but these errors were encountered: