Code Monkey home page Code Monkey logo

elf_reader's People

Contributors

yalue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

elf_reader's Issues

Uncaught Exception in Elf_Reader Library

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
}

3f8464509969c6477a2adc88eeed8848f3ca8371.zip

API is not very friendly

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.