{"id":17944816,"url":"https://github.com/reloaded-project/reloaded.memory.buffers","last_synced_at":"2025-03-24T18:32:25.853Z","repository":{"id":33799322,"uuid":"162502116","full_name":"Reloaded-Project/Reloaded.Memory.Buffers","owner":"Reloaded-Project","description":"[C# \u0026 Rust] An implementation of efficient, shared, concurrent and permanent storage of objects in unmanaged memory in static, non-changing locations that last the lifetime of a given process.","archived":false,"fork":false,"pushed_at":"2024-04-05T17:03:20.000Z","size":3612,"stargazers_count":20,"open_issues_count":5,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-16T06:10:28.425Z","etag":null,"topics":["c-sharp","game-hacking","hacking","memory","process-manipulation","reloaded","windows"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Reloaded-Project.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"Sewer56"}},"created_at":"2018-12-19T23:33:19.000Z","updated_at":"2024-06-15T22:31:34.601Z","dependencies_parsed_at":"2023-11-18T03:49:27.270Z","dependency_job_id":"e7d72445-308d-48c4-bc93-4d6d29e1aa29","html_url":"https://github.com/Reloaded-Project/Reloaded.Memory.Buffers","commit_stats":{"total_commits":75,"total_committers":3,"mean_commits":25.0,"dds":0.4933333333333333,"last_synced_commit":"6e891b95d7b0b9402912f1d225e706d3d8ffdd6f"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reloaded-Project%2FReloaded.Memory.Buffers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reloaded-Project%2FReloaded.Memory.Buffers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reloaded-Project%2FReloaded.Memory.Buffers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reloaded-Project%2FReloaded.Memory.Buffers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Reloaded-Project","download_url":"https://codeload.github.com/Reloaded-Project/Reloaded.Memory.Buffers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221997290,"owners_count":16913723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-sharp","game-hacking","hacking","memory","process-manipulation","reloaded","windows"],"created_at":"2024-10-29T06:05:13.520Z","updated_at":"2024-10-29T06:05:14.162Z","avatar_url":"https://github.com/Reloaded-Project.png","language":"Rust","readme":"\u003cdiv align=\"center\"\u003e\r\n\t\u003ch1\u003eThe Reloaded Buffers Library\u003c/h1\u003e\r\n\t\u003cimg src=\"hhttps://raw.githubusercontent.com/Reloaded-Project/Reloaded.MkDocsMaterial.Themes.R2/adc12754862c5107fcd1357c7501e4d9d9f09d07/Images/Reloaded-Icon.png\" width=\"150\" align=\"center\" /\u003e\r\n\t\u003cbr/\u003e \u003cbr/\u003e\r\n\t\u003cstrong\u003e\u003ci\u003eAllocate Memory, \u0026 Knuckles\u003c/i\u003e\u003c/strong\u003e\r\n\t\u003cbr/\u003e \u003cbr/\u003e\r\n\t\u003c!-- Coverage --\u003e\r\n\t\u003ca href=\"https://codecov.io/gh/Reloaded-Project/Reloaded.Memory.Buffers\"\u003e\r\n\t\t\u003cimg src=\"https://codecov.io/gh/Reloaded-Project/Reloaded.Memory.Buffers/branch/master/graph/badge.svg\" alt=\"Coverage\" /\u003e\r\n\t\u003c/a\u003e\r\n\t\u003c!-- Crates --\u003e\r\n\t\u003ca href=\"https://crates.io/crates/reloaded_memory_buffers\"\u003e\r\n\t\t\u003cimg src=\"https://img.shields.io/crates/dv/reloaded_memory_buffers\" alt=\"NuGet\" /\u003e\r\n\t\u003c/a\u003e\r\n\t\u003c!-- Build Status --\u003e\r\n\t\u003ca href=\"https://github.com/Reloaded-Project/Reloaded.Memory.Buffers/actions/workflows/rust.yml\"\u003e\r\n\t\t\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/Reloaded-Project/Reloaded.Memory.Buffers/rust.yml\" alt=\"Build Status\" /\u003e\r\n\t\u003c/a\u003e\r\n\t\u003cbr/\u003e\r\n\t\u003c!-- NuGet --\u003e\r\n\t\u003ca href=\"https://www.nuget.org/packages/Reloaded.Memory.Buffers\"\u003e\r\n\t\t\u003cimg src=\"https://img.shields.io/nuget/v/Reloaded.Memory.Buffers.svg\" alt=\"NuGet\" /\u003e\r\n\t\u003c/a\u003e\r\n\t\u003c!-- Build Status --\u003e\r\n\t\u003ca href=\"https://github.com/Reloaded-Project/Reloaded.Memory.Buffers/actions/workflows/build-and-publish.yml\"\u003e\r\n\t\t\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/Reloaded-Project/Reloaded.Memory.Buffers/build-and-publish.yml\" alt=\"Build Status\" /\u003e\r\n\t\u003c/a\u003e\r\n\u003c/div\u003e\r\n\r\n## About\r\n\r\n`Reloaded.Memory.Buffers` is a library for allocating memory between a given minimum and maximum memory address, for C# and Rust.\r\n\r\nWith the following properties:\r\n\r\n- ***Memory Efficient***: No wasted memory.  \r\n- ***Shared***: Can be found and read/written to by multiple users.  \r\n- ***Static***: Allocated data never moves, or is overwritten.  \r\n- ***Permanent***: Allocated data lasts the lifetime of the process.  \r\n- ***Concurrent***: Multiple users can access at the same time.  \r\n- ***Large Address Aware:*** On Windows, the library can correctly leverage all 4GB in 32-bit processes.  \r\n- ***Cross Platform***: Supports Windows, OSX and Linux.  \r\n\r\nNote: Rust/C port also work with FreeBSD (untested), and has partial [(limited) Android support](https://github.com/Reloaded-Project/Reloaded.Memory.Buffers/issues/3).\r\n\r\n## Wiki \u0026 Documentation\r\n\r\n[For full documentation, please see the Wiki](https://reloaded-project.github.io/Reloaded.Memory.Buffers/).  \r\n\r\n## Example Use Cases\r\n\r\nThese are just examples:  \r\n\r\n- ***Hooks***: Hooking libraries like [Reloaded.Hooks](https://github.com/Reloaded-Project/Reloaded.Hooks) can reduce amount of bytes stolen from functions.\r\n- ***Libraries***: Libraries like [Reloaded.Assembler](https://github.com/Reloaded-Project/Reloaded.Assembler) require memory be allocated in first 2GB for x64 FASM.\r\n\r\n## Usage\r\n\r\n!!! info \"The library provides a simple high level API to use.\"\r\n\r\n!!! info \"See [Wiki](https://reloaded-project.github.io/Reloaded.Memory.Buffers/) for Rust usage\"\r\n\r\n### Get A Buffer\r\n\r\nGets a buffer where you can allocate 4096 bytes in first 2GiB of address space.\r\n\r\n```csharp\r\nvar settings = new BufferSearchSettings()\r\n{\r\n    MinAddress = 0,\r\n    MaxAddress = int.MaxValue,\r\n    Size = 4096\r\n};\r\n\r\n// Make sure to dispose, so lock gets released.\r\nusing var item = Buffers.GetBuffer(settings);\r\n\r\n// Write some data, get pointer back.\r\nvar ptr = item-\u003eAppend(data); \r\n```\r\n\r\n### Get A Buffer (With Proximity)\r\n\r\nGets a buffer where 4096 bytes written will be within 2GiB of 0x140000000.\r\n\r\n```csharp\r\nvar settings = BufferSearchSettings.FromProximity(int.MaxValue, (nuint)0x140000000, 4096);\r\n\r\n// Make sure to dispose, so lock gets released.\r\nusing var item = Buffers.GetBuffer(settings);\r\n\r\n// Write some data, get pointer back.\r\nvar ptr = item-\u003eAppend(data); \r\n```\r\n\r\n### Allocate Memory\r\n\r\nAllows you to temporarily allocate memory within a specific address range and size constraints.\r\n\r\n```csharp\r\n// Arrange\r\nvar settings = new BufferAllocatorSettings()\r\n{\r\n    MinAddress = 0,\r\n    MaxAddress = int.MaxValue,\r\n    Size = 4096\r\n};\r\n\r\nusing var item = Buffers.AllocatePrivateMemory(settings);\r\n\r\n// You have allocated memory in first 2GiB of address space.\r\n// Disposing this memory (via `using` statement) will free it.\r\nitem.BaseAddress.Should().NotBeNull();\r\nitem.Size.Should().BeGreaterOrEqualTo(settings.Size);\r\n```\r\n\r\nYou can specify another process with `TargetProcess = someProcess` in `BufferAllocatorSettings`, but this is only supported on Windows.\r\n\r\n## Crate Features (Rust)\r\n\r\n- `std`: [Enabled by Default] Enables use of standard library.  \r\n- `external_processes`: Support external processes (windows only).    \r\n- `no_format`: Disables formatting code in errors, saving ~8kB of space.  \r\n- `size_opt`: Makes cold paths optimized for size instead of optimized for speed. [Requires 'nightly' Rust]  \r\n- `c_exports` Provides C exports for the library.    \r\n\r\n## Community Feedback\r\n\r\nIf you have questions/bug reports/etc. feel free to [Open an Issue](https://github.com/Reloaded-Project/Reloaded.Memory.Buffers/issues/new).\r\n\r\nContributions are welcome and encouraged. Feel free to implement new features, make bug fixes or suggestions so long as\r\nthey meet the quality standards set by the existing code in the repository.\r\n\r\nFor an idea as to how things are set up, [see Reloaded Project Configurations.](https://github.com/Reloaded-Project/Reloaded.Project.Configurations)\r\n\r\nHappy Hacking 💜","funding_links":["https://github.com/sponsors/Sewer56"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freloaded-project%2Freloaded.memory.buffers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freloaded-project%2Freloaded.memory.buffers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freloaded-project%2Freloaded.memory.buffers/lists"}