Skip to content

Instantly share code, notes, and snippets.

@h3ku h3ku/Compile.txt
Last active Mar 27, 2018

Embed
What would you like to do?
Hook fail asserts to prevent false positives with AFL
go build -buildmode=c-shared -o fail_assert.so main.go
Then just LD_PRELOAD the generated .so
package main
import (
"C"
"github.com/rainycape/dl"
"log"
)
func main() {}
//export __assert_fail
func __assert_fail() {
lib, err := dl.Open("libc", 0)
if err != nil {
log.Fatalln(err)
}
defer lib.Close()
var exit_func func()
lib.Sym("exit", &exit_func)
exit_func()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.