mirror of
https://github.com/yuzu-emu/unicorn
synced 2024-11-24 20:28:29 +00:00
9f0cdc4be9
Update eflags_nosync.c Update sigill2.c Update ro_mem_test.c Update ro_mem_test.c Update nr_mem_test.c Update mem_fuzz.c Update mem_double_unmap.c Update emu_stop_in_hook_overrun.c Update eflags_nosync.c remove unused Update Makefile Update Makefile Update Makefile Update Makefile Update Makefile Update Makefile Update Makefile Update mem_64_c.c Update mem_64_c.c Update Makefile Update Makefile Update Makefile Update Makefile Update Makefile Update Makefile Update .travis.yml try android ndk build Update unicorn.py Update unicorn.py Update Makefile Update unicorn.py Update unicorn.py remove an untrue comment if a dll/so/dylib gets loaded at runtime is dependent on many different factors, primarily the LD/DYLD paths. Those do not always include the current working directory Update Makefile Update .appveyor.yml Update .travis.yml Update Makefile Update .appveyor.yml Fix bad sample |
||
---|---|---|
.. | ||
unicorn | ||
Makefile | ||
README.md | ||
sample.go |
To download/update the Unicorn Go bindings, run:
go get -u github.com/unicorn-engine/unicorn/bindings/go
A very basic usage example follows
(Does not handle most errors for brevity. Please see sample.go for a more hygenic example):
package main
import (
"fmt"
uc "github.com/unicorn-engine/unicorn/bindings/go/unicorn"
)
func main() {
mu, _ := uc.NewUnicorn(uc.ARCH_X86, uc.MODE_32)
// mov eax, 1234
code := []byte{184, 210, 4, 0, 0}
mu.MemMap(0x1000, 0x1000)
mu.MemWrite(0x1000, code)
if err := mu.Start(0x1000, 0x1000+uint64(len(code))); err != nil {
panic(err)
}
eax, _ := mu.RegRead(uc.X86_REG_EAX)
fmt.Printf("EAX is now: %d\n", eax)
}
An example program exercising far more Unicorn functionality and error handling can be found in sample.go.