All Projects → pkujhd → Goloader

pkujhd / Goloader

Licence: apache-2.0
load and run golang code at runtime.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Goloader

Element Web
element.io docker image generator
Stars: ✭ 21 (-86.79%)
Mutual labels:  arm64, arm
Synestiaos
The Synestia Operating System
Stars: ✭ 159 (+0%)
Mutual labels:  arm64, arm
Keypatch
Multi-architecture assembler for IDA Pro. Powered by Keystone Engine.
Stars: ✭ 939 (+490.57%)
Mutual labels:  arm64, arm
Capstone
Capstone disassembly/disassembler framework: Core (Arm, Arm64, BPF, EVM, M68K, M680X, MOS65xx, Mips, PPC, RISCV, Sparc, SystemZ, TMS320C64x, Web Assembly, X86, X86_64, XCore) + bindings.
Stars: ✭ 5,374 (+3279.87%)
Mutual labels:  arm64, arm
Axbaseplugin
Android Plugin Framework
Stars: ✭ 122 (-23.27%)
Mutual labels:  plugin, dynamic
Goloader
load and run golang code at runtime. (WARNING: this repo has not been maintained for a long time, please take a look at https://github.com/pkujhd/goloader)
Stars: ✭ 564 (+254.72%)
Mutual labels:  plugin, dynamic
Homebridge Fritz Platform
AiO Homebridge dynamic platform plugin for AVM hardware like Fritz!Box, Fritz!Repeater etc.
Stars: ✭ 101 (-36.48%)
Mutual labels:  plugin, dynamic
Grassbending
A replacement for Unity's terrain grass shader with alpha blended rendering and touch bending effect
Stars: ✭ 397 (+149.69%)
Mutual labels:  plugin, dynamic
Docker Homebridge
Homebridge Docker. HomeKit support for the impatient using Docker on x86_64, Raspberry Pi (armhf) and ARM64. Includes ffmpeg + libfdk-aac.
Stars: ✭ 1,847 (+1061.64%)
Mutual labels:  arm64, arm
Keystone
Keystone assembler framework: Core (Arm, Arm64, Hexagon, Mips, PowerPC, Sparc, SystemZ & X86) + bindings
Stars: ✭ 1,654 (+940.25%)
Mutual labels:  arm64, arm
Docker Cloudflare Ddns
A small amd64/ARM/ARM64 Docker image that allows you to use CloudFlare as a DDNS / DynDNS Provider.
Stars: ✭ 467 (+193.71%)
Mutual labels:  arm64, arm
Msm8994 8992 Nt Arm64 Drivers
Desktop Windows (ARM64) driver collection for MSM8992/8994 SoCs.
Stars: ✭ 132 (-16.98%)
Mutual labels:  arm64, arm
Raspberry Pi Pcie Devices
Raspberry Pi PCI Express device compatibility database
Stars: ✭ 444 (+179.25%)
Mutual labels:  arm64, arm
Raspberrypipkg
DEPRECATED - DO NOT USE | Go here instead ->
Stars: ✭ 758 (+376.73%)
Mutual labels:  arm64, arm
Unicorn
Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, PowerPC, RiscV, X86)
Stars: ✭ 4,934 (+3003.14%)
Mutual labels:  arm64, arm
Simde
Implementations of SIMD instruction sets for systems which don't natively support them.
Stars: ✭ 1,012 (+536.48%)
Mutual labels:  arm64, arm
Grafana On Raspberry
Grafana packages for raspberry pi (armv6/armv7) and aarch64/arm64
Stars: ✭ 318 (+100%)
Mutual labels:  arm64, arm
Uefi Ntfs
UEFI:NTFS - Boot NTFS partitions from UEFI
Stars: ✭ 386 (+142.77%)
Mutual labels:  arm64, arm
Tensorflow Mtcnn
C++ and python Inference only for MTCNN face detector on Tensorflow. Based on davidsandberg's facenet project:
Stars: ✭ 106 (-33.33%)
Mutual labels:  arm64, arm
Tina
Tina is a teeny tiny, header only, coroutine and job library.
Stars: ✭ 125 (-21.38%)
Mutual labels:  arm64, arm

Goloader

Build Status

Goloader can load and run Golang code at runtime.

Forked from https://github.com/dearplain/goloader, Take over maintenance because the original author is not in maintenance

How does it work?

Goloader works like a linker: it relocates the address of symbols in an object file, generates runnable code, and then reuses the runtime function and the type pointer of the loader.

Goloader provides some information to the runtime and gc of Go, which allows it to work correctly with them.

Please note that Goloader is not a scripting engine. It reads the output of Go compiler and makes them runnable. All features of Go are supported, and run just as fast and lightweight as native Go code.

Comparison with plugin

Goloader reuses the Go runtime, which makes it much smaller. And code loaded by Goloader is unloadable.

Goloader is debuggable, and supports pprof tool(Yes, you can see code loaded by Goloader in pprof).

Build

Make sure you're using go >= 1.8.

First, execute the following command, then do build and test. This is because Goloader relies on the internal package, which is forbidden by the Go compiler.

cp -r $GOROOT/src/cmd/internal $GOROOT/src/cmd/objfile

Examples

export GO111MODULE=auto
go build github.com/pkujhd/goloader/examples/loader

go tool compile $GOPATH/src/github.com/pkujhd/goloader/examples/schedule/schedule.go
./loader -o schedule.o -run main.main -times 10

go tool compile $GOPATH/src/github.com/pkujhd/goloader/examples/base/base.go
./loader -o base.o -run main.main

go tool compile $GOPATH/src/github.com/pkujhd/goloader/examples/http/http.go
./loader -o http.o -run main.main

go install github.com/pkujhd/goloader/examples/basecontext
go tool compile -I $GOPATH/pkg/`go env GOOS`_`go env GOARCH`/ $GOPATH/src/github.com/pkujhd/goloader/examples/inter/inter.go
./loader -o $GOPATH/pkg/`go env GOOS`_`go env GOARCH`/github.com/pkujhd/goloader/examples/basecontext.a:github.com/pkujhd/goloader/examples/basecontext -o inter.o

#build multiple go files
go tool compile -I $GOPATH/pkg/`go env GOOS`_`go env GOARCH`/ -o test.o test1.go test2.go
./loader -o test.o -run main.main

Warning

This has currently only been tested and developed on:

Golang 1.8-1.16 (x64/x86, darwin, linux, windows)

Golang 1.10-1.16 (arm, linux)

Golang 1.8-1.16 (arm64(LE) linux)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].