yalue / elf_reader Goto Github PK
View Code? Open in Web Editor NEWA Go library for reading and parsing ELF files
License: MIT License
A Go library for reading and parsing ELF files
License: MIT License
We discovered a crash in Elf_Reader library because of 'Uncaught Exception' via specially crafted input.
Here is the crash log:
goroutine 1 [running]:
github.com/yalue/elf_reader.(*ELF32File).GetSectionContent(0x0?, 0x0?)
/home/ubuntu/go/pkg/mod/github.com/yalue/[email protected]/elf32_format.go:467 +0x289
github.com/yalue/elf_reader.(*ELF32File).GetSectionName(0xc00019a000, 0x1)
/home/ubuntu/go/pkg/mod/github.com/yalue/[email protected]/elf32_format.go:508 +0x7f
fuzz_test.Fuzz({0x7fd9b0f45000?, 0x11?, 0xc0000c2730?})
/home/ubuntu/targets/math/main.go:21 +0x210
go-fuzz-dep.Main({0xc0000f4f68, 0x1, 0x4a76e0?})
go-fuzz-dep/main.go:36 +0x15a
main.main()
fuzz_test/go.fuzz.main/main.go:15 +0x3b
exit status 2
Harness File:
package fuzz_test
import (
"fmt"
"github.com/yalue/elf_reader"
)
func Fuzz(data []byte) int {
elf_reader.ParseELFFile()
elf, e := elf_reader.ParseELFFile(data)
if e != nil {
fmt.Printf("Failed parsing ELF file: %s\n", e)
return 0
}
count := elf.GetSectionCount()
for i := uint16(0); i < count; i++ {
if i == 0 {
fmt.Printf("Section 0: NULL section (no name)\n")
continue
}
name, e := elf.GetSectionName(uint16(i))
if e != nil {
fmt.Printf("Failed getting section %d name: %s\n", i, e)
continue
}
fmt.Printf("Section %d name: %s\n", i, name)
}
return 0
}
it's a very useful library, but the API didn't feel very friendly during my use.
such as elf.DynamicEntries(intex uint16)
, first i need to find the index of
dynamic section, but I think the library can get the index by itself.
additional, can provides some other APIs, such as get needed libraries of dynamic section.
thanks your lib.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.