{"id":21937351,"url":"https://github.com/jasondrawdy/memorymapper","last_synced_at":"2025-09-25T19:34:54.738Z","repository":{"id":183138491,"uuid":"141960119","full_name":"jasondrawdy/MemoryMapper","owner":"jasondrawdy","description":"Lightweight library which allows the ability to map both native and managed assemblies into memory by either using process injection of a process specified by the user or self-injection.","archived":false,"fork":false,"pushed_at":"2020-05-01T21:12:01.000Z","size":20,"stargazers_count":32,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-22T12:07:30.545Z","etag":null,"topics":["assemblies","cryptography","library","managed","memory","memory-allocation","memory-hacking","memory-management","native-module","security","windows"],"latest_commit_sha":null,"homepage":"","language":"C#","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/jasondrawdy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-07-23T04:14:17.000Z","updated_at":"2024-11-21T08:33:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"f785b262-c2a3-47bd-85f4-330bba721e29","html_url":"https://github.com/jasondrawdy/MemoryMapper","commit_stats":null,"previous_names":["jasondrawdy/memorymapper"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasondrawdy%2FMemoryMapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasondrawdy%2FMemoryMapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasondrawdy%2FMemoryMapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasondrawdy%2FMemoryMapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jasondrawdy","download_url":"https://codeload.github.com/jasondrawdy/MemoryMapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250237832,"owners_count":21397401,"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":["assemblies","cryptography","library","managed","memory","memory-allocation","memory-hacking","memory-management","native-module","security","windows"],"created_at":"2024-11-29T01:19:14.009Z","updated_at":"2025-09-25T19:34:54.638Z","avatar_url":"https://github.com/jasondrawdy.png","language":"C#","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg width=\"256\" height=\"256\" src=\"https://user-images.githubusercontent.com/40871836/43434251-81f1bcb6-9440-11e8-8eaa-505914246ae6.png\"\u003e\n\u003cp\u003e\n\n# Memory Mapper\n\u003cp align=\"left\"\u003e\n    \u003c!-- Version --\u003e\n    \u003cimg src=\"https://img.shields.io/badge/version-1.0.0-brightgreen.svg\"\u003e\n    \u003c!-- \u003cimg src=\"https://img.shields.io/appveyor/ci/gruntjs/grunt.svg\"\u003e --\u003e\n    \u003c!-- Docs --\u003e\n    \u003cimg src=\"https://img.shields.io/badge/docs-not%20found-lightgrey.svg\"\u003e\n    \u003c!-- License --\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\"\u003e\n\u003c/p\u003e\n\nMemory Mapper is a lightweight library which allows the ability to map both native and managed assemblies into memory by either using process injection of a process specified by the user or self-injection; the technique of injecting an assembly into the currently running process attempting to do the injection. The library comes with tools not only to map assemblies, but with the capabilities to encrypt, decrypt, and generate various amounts of cryptographically strong data.\n\n### Requirements\n***Note:*** *(For the running assembly using Memory Mapper ***ONLY*** — not for stubs/shellcode)*\n\n- Windows 7 SP1 \u0026 Higher\n- .NET Framework 4.6.1\n\n# Features\n- Explore the structure of a PE (portable executable)\n- Read resources from both managed and native assemblies\n- Map native assemblies into memory using process injection and self-injection\n- Map managed assemblies into memory using process injection and other techniques\n- Obtain an array of bytes for any file of any file size\n- Encrypt and decrypt entire files and raw bytes\n- Generate and validate checksums of files and raw bytes\n- Generate cryptographically strong random data using a `SecureRandom` object\n- Comes bundled with multiple encryption and hashing algorithms\n    #### Encryption\n    - AES *(ECB)*\n    - AES *(CBC)*\n    - AES *(CFB)*\n    - AES *(OFB)*\n    - AES *(CTR)*\n\n    #### Hashing\n    - MD5\n    - RIPEMD160\n    - SHA1\n    - SHA256\n    - SHA384\n    - SHA512\n\n# Examples\n### Native Injection\nThis example shows how to statically map a native assembly into memory using the `NativeLoader` tool. The example loads the file by reading all of its bytes from disk and then injects the *PE (portable executable)* associated with the bytes directly into memory. Using the native loader in conjunction with *Dynamic Code Compilation* found in my [Amaterasu](https://github.com/CloneMerge/Amaterasu) library one could accomplish on-the-fly code compilation and injection all from code in-memory.\n\n```c#\nusing System;\nusing System.IO;\nusing System.Reflection;\nusing MemoryMapper;\n\nnamespace Example\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // Get the bytes of the file we want to load.\n            var filePath = \"FileToReadBytesOf\";\n            var fileBytes = File.ReadAllBytes(filePath);\n\n            // Check if the assembly is managed or native.\n            bool isManaged = false;\n            try\n            {\n                // Note — this is one of the simplest variations of checking assemblies\n                var assemblyName = AssemblyName.GetAssemblyName(filePath);\n                if (assemblyName != null)\n                    if (assemblyName.FullName != null)\n                        isManaged = true;\n            }\n            catch { isManaged = false; }\n\n            // Try loading the assembly if it's truly native.\n            if (!isManaged)\n            {\n                NativeLoader loader = new NativeLoader();\n                if (loader.LoadAssembly(fileBytes))\n                    Console.WriteLine(\"Assembly loaded successfully!\");\n                else\n                    Console.WriteLine(\"Assembly could not be loaded.\");\n            }\n\n            // Wait for user interaction.\n            Console.Read();\n        }\n    }\n}\n```\n\n### Managed Injection\nThis example shows how to statically map a managed assembly into memory by reading in its bytes — or by using an embedded byte array — and then using the `ManagedLoader` to inject into a currently running process. Almost any managed assembly can be mapped using the provided `ManagedLoader` tool.\n\n```c#\nusing System;\nusing System.IO;\nusing System.Reflection;\nusing MemoryMapper;\n\nnamespace Example\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // Get the bytes of the file we want to load.\n            var filePath = \"FileToReadBytesOf\";\n            var fileBytes = File.ReadAllBytes(filePath);\n\n            // Check if the assembly is managed or native.\n            bool isManaged = false;\n            try\n            {\n                // Note — this is one of the simplest variations of checking assemblies\n                var assemblyName = AssemblyName.GetAssemblyName(filePath);\n                if (assemblyName != null)\n                    if (assemblyName.FullName != null)\n                        isManaged = true;\n            }\n            catch { isManaged = false; }\n\n            // Try loading the assembly if it's truly managed.\n            if (isManaged)\n            {\n                // Set the name of a surrogate process - the process we'll inject into.\n                var processName = \"explorer.exe\"; // Can also be the current process's name for self-injection.\n                ManagedLoader loader = new ManagedLoader();\n                if (loader.LoadAssembly(fileBytes, processName))\n                    Console.WriteLine(\"Assembly loaded successfully!\");\n                else\n                    Console.WriteLine(\"Assembly could not be loaded.\");\n            }\n\n            // Wait for user interaction.\n            Console.Read();\n        }\n    }\n}\n```\n# Credits\n**Icon:** `DesignBolts` \u003cbr\u003e\nhttp://www.designbolts.com/\n\n# License\n\nCopyright © ∞ Jason Drawdy \n\nAll rights reserved.\n\nThe MIT License (MIT)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\nExcept as contained in this notice, the name of the above copyright holder\nshall not be used in advertising or otherwise to promote the sale, use or\nother dealings in this Software without prior written authorization.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasondrawdy%2Fmemorymapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasondrawdy%2Fmemorymapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasondrawdy%2Fmemorymapper/lists"}