memorigo

package module
v0.0.0-...-f932273 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2022 License: LGPL-3.0 Imports: 5 Imported by: 0

README

memorigo

A simple library for manipulating processes' memory in Go.

For now, works only on Linux based systems.

Installing

go get git.debooger.xyz/debooger/memorigo

Inclusion

import (
	mem "git.debooger.xyz/debooger/memorigo"
)

Example

pid, err := mem.Pidof("csgo_linux64")
if err != nil {
	fmt.Println(err)
	os.Exit(1)
}

client, err := mem.GetModule(pid, "csgo/bin/linux64/client_client.so")
if err != nil {
	fmt.Println(err)
	os.Exit(1)
}

value, err := mem.Read[int32](pid, client.Start + 45682996)
if err != nil {
	fmt.Println(err)
	os.Exit(1)
}

fmt.Println(value)

err := mem.Write[int32](pid, client.Start + 45682996, 5)
if err != nil {
	fmt.Println(err)
	os.Exit(1)
}

License

Copyright (c) 2022 debooger

This project is licensed under the GNU LGPLv3+ license.

Documentation

Index

Constants

View Source
const (
	SYS_PROCESS_VM_READV  = 310
	SYS_PROCESS_VM_WRITEV = 311
)

Variables

This section is empty.

Functions

func Pidof

func Pidof(name string) (uint64, error)

func Read

func Read[T interface{}](pid uint64, addr uintptr) (T, error)

func Write

func Write[T interface{}](pid uint64, addr uintptr, val T) error

Types

type Module

type Module struct {
	Start uintptr
	End   uintptr
}

func GetModule

func GetModule(pid uint64, name string) (Module, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL