https://github.com/rssu-shellcode/grt-config
Configure Gleam-RT options and Encode/Decode argument stub.
https://github.com/rssu-shellcode/grt-config
gleam-rt
Last synced: about 1 year ago
JSON representation
Configure Gleam-RT options and Encode/Decode argument stub.
- Host: GitHub
- URL: https://github.com/rssu-shellcode/grt-config
- Owner: RSSU-Shellcode
- License: mit
- Created: 2024-09-02T11:55:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-18T08:02:31.000Z (about 1 year ago)
- Last Synced: 2025-01-18T08:35:11.799Z (about 1 year ago)
- Topics: gleam-rt
- Language: Go
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GRT-Config
A package for configure Gleam-RT options and Encode/Decode argument stub.
## Usage
```go
package main
import (
"fmt"
"os"
"github.com/RSSU-Shellcode/GRT-Config/argument"
"github.com/RSSU-Shellcode/GRT-Config/option"
)
func main() {
tpl, err := os.ReadFile("Gleam-RT.bin")
checkError(err)
opts := option.Options{
NotEraseInstruction: false,
NotAdjustProtect: false,
TrackCurrentThread: false,
}
tpl, err = option.Set(tpl, &opts)
checkError(err)
arg1 := &argument.Arg{
ID: 0,
Data: []byte("arg1"),
}
arg2 := &argument.Arg{
ID: 1,
Data: []byte("arg2"),
}
stub, err := argument.Encode(arg1, arg2)
checkError(err)
output := append(tpl, stub...)
err = os.WriteFile("output.bin", output, 0600)
checkError(err)
}
func checkError(err error) {
if err != nil {
fmt.Println(err)
os.Exit(1)
}
}
```