Open timwhitez opened 2 years ago
i want to load https://github.com/trustedsec/ELFLoader this program
package main import ( "github.com/Binject/universal" "io/ioutil" "log" "syscall" "unsafe" ) func main() { image, err := ioutil.ReadFile("libELFLoader.so") loader, err := universal.NewLoader() if err != nil { log.Fatal(err) } library, err := loader.LoadLibrary("main", &image) if err != nil { log.Fatal(err) } g, _ := syscall.BytePtrFromString("go") f, _ := ioutil.ReadFile("whoami.o") inDataBuff := uintptr(unsafe.Pointer(&f[0])) inDataSize := uintptr(uint64(len(f))) val, err := library.Call("ELFRunner", uintptr(unsafe.Pointer(g)), inDataBuff, inDataSize, 0, 0) if err != nil { //log.Fatal(err) } log.Printf("%+v\n", val) }
but didn't work
You would have to modify it, taking a look at the source code I noticed that it uses: https://github.com/awgh/cppgo/blob/master/asmcall/cdecl/cdecl.go you can directly call it
i want to load https://github.com/trustedsec/ELFLoader this program
but didn't work