Skip to content

Latest commit

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

MemoryLib

A cross-platform memory library. MacOS does not exist.

Usage

Cross-platform usage

usingHoLLy.Memory.CrossPlatform;// open a processProcessproc=Process.Open(0x123);// alternatively Process.OpenAllByName("process.exe").Single()// find a byte patternPatternByte[]pattern=PatternByte.Parse("12 34 ?? FF AB");if(!proc.Scan(pattern,false,outUIntPtraddr))// second parameter filters mapped sectionsthrownewException();// read-write to memoryuintx=proc.ReadU32(addr);proc.Write(addr,x*2);

Platform-specific usage

usingHoLLy.Memory.Linux;// open a processProcessproc=newLinuxProcess(0x123);// alternatively LinuxProcess.GetProcessesByName("process").Single()// print all regionsforeach(varregioninproc.GetMemoryRegions()){Console.WriteLine(regionisLinuxMemoryRegionlinuxReg&&linuxReg.PathName!=null?$"{region.Start:X}-{region.End:X}{region.PermissionString},\t{linuxReg.PathName} @{linuxReg.Offset:X}":$"{region.Start:X}-{region.End:X}{region.PermissionString}");}

Linux note

To read/write memory without root, add the CAP_SYS_PTRACE capability to the executable: setcap cap_sys_ptrace+ep <executable>

About

A cross-platform memory library

Topics

Resources

Stars

16 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages