trainerKit

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

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

Go to latest
Published: Dec 21, 2016 License: MIT Imports: 7 Imported by: 0

README

go-trainerKit

Documentation

Index

Constants

View Source
const (
	ERROR_NO_MORE_FILES = 0x12
	MAX_PATH            = 260
)

Some constants from the Windows API

View Source
const (
	All              = 0x001F0FFF
	Terminate        = 0x00000001
	CreateThread     = 0x00000002
	VMOperation      = 0x00000008
	VMRead           = 0x00000010
	VMWrite          = 0x00000020
	DupHandle        = 0x00000040
	SetInformation   = 0x00000200
	QueryInformation = 0x00000400
	Synchronize      = 0x00100000
	LIST_MODULES_ALL = 0x03
)

Variables

This section is empty.

Functions

func EnumProcessModules

func EnumProcessModules(handle uintptr)

func EnumProcesses

func EnumProcesses() (result uintptr, res []uint16)

func FindModule

func FindModule(handle uintptr, moduleName string) (retHandle uintptr)

func FindWindow

func FindWindow(lpClassName string, lpWindowName string) (result uintptr)

func GetModuleBaseName

func GetModuleBaseName(handle uintptr, handleMod uintptr) (result uintptr, res string)

func GetModuleFileNameEx

func GetModuleFileNameEx(handle uintptr, handleMod uintptr) (result uintptr, res string)

func GetName

func GetName(handle uintptr) (name string)

func GetWindowThreadProcessId

func GetWindowThreadProcessId(window uintptr) (result uintptr, handle uintptr)

func OpenProcess

func OpenProcess(dwDesiredAccess int, bInheritHandle int, dwProcessId uintptr) (result uintptr)

func ReadProcessMemory

func ReadProcessMemory(hProcess uintptr, lpBaseAddress uintptr, nSize int) (result uintptr, lpBuffer []byte, lpNumberOfBytesWritten uintptr)

func UintptrToString

func UintptrToString(v uintptr) string

func WriteProcessMemory

func WriteProcessMemory(hProcess uintptr, lpBaseAddress uintptr, lpBuffer []byte, nSize int) (result uintptr, lpNumberOfBytesWritten uintptr)

Types

type PROCESSENTRY32

type PROCESSENTRY32 struct {
	Size              uint32
	CntUsage          uint32
	ProcessID         uint32
	DefaultHeapID     uintptr
	ModuleID          uint32
	CntThreads        uint32
	ParentProcessID   uint32
	PriorityClassBase int32
	Flags             uint32
	ExeFile           [MAX_PATH]uint16
}

PROCESSENTRY32 is the Windows API structure that contains a process's information.

type PointerModel

type PointerModel struct {
	Offsets     []uint32
	BaseAddress uint32

	DllName string
	// contains filtered or unexported fields
}

func (*PointerModel) FindDmaAddress

func (pointerM *PointerModel) FindDmaAddress(win Window)

func (*PointerModel) Read

func (pointerM *PointerModel) Read(win Window) uint32

func (*PointerModel) Write

func (pointerM *PointerModel) Write(win Window, value []byte)

type Process

type Process interface {
	// Pid is the process ID for this process.
	Pid() int

	// PPid is the parent process ID for this process.
	PPid() int

	// Executable name running this process. This is not a path to the
	// executable.
	Executable() string
}

Process is the generic interface that is implemented on every platform and provides common operations for processes.

func FindProcess

func FindProcess(pid int) (Process, error)

FindProcess looks up a single process by pid.

Process will be nil and error will be nil if a matching process is not found.

func Processes

func Processes() ([]Process, error)

Processes returns all processes.

This of course will be a point-in-time snapshot of when this method was called. Some operating systems don't provide snapshot capability of the process table, in which case the process table returned might contain ephemeral entities that happened to be running when this was called.

type Window

type Window struct {
	WindowName string

	ExeName string
	// contains filtered or unexported fields
}

func (*Window) Open

func (win *Window) Open() (err error)

func (*Window) Write

func (win *Window) Write(pointer PointerModel) (err error)

type WindowsProcess

type WindowsProcess struct {
	// contains filtered or unexported fields
}

WindowsProcess is an implementation of Process for Windows.

func (*WindowsProcess) Executable

func (p *WindowsProcess) Executable() string

func (*WindowsProcess) PPid

func (p *WindowsProcess) PPid() int

func (*WindowsProcess) Pid

func (p *WindowsProcess) Pid() int

Jump to

Keyboard shortcuts

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