Andoryuuta / kiwi

A package for memory editing in go.
MIT License
38 stars 7 forks source link
go golang memory memory-editing memory-hacking

Kiwi

GoDoc

A package for memory editing in go.

Current Features

Future plans

Installation

go get github.com/Andoryuuta/kiwi

Usage

package main

import (
    "log"

    "github.com/Andoryuuta/kiwi"
)

func main() {
    // The memory address of variable inside of target process.
    externVarAddr := uintptr(0x001A51E8)

    // Find the process from the executable name.
    proc, err := kiwi.GetProcessByFileName("example.exe")
    if err != nil {
        log.Fatalln("Error while trying to find process.")
    }

    // Read from the target process.
    externVar, err := proc.ReadUint32(externVarAddr)
    if err != nil {
        log.Fatalln("Error while trying to read from target process.")
    }

    // Output the variable we read.
    log.Println("Read", externVar)

    // Write a new value of 1000 to the variable
    err = proc.WriteUint32(externVarAddr, 1000)
    if err != nil {
        log.Fatal(err)
    }
}