{"id":13841032,"url":"https://github.com/nettitude/RunPE","last_synced_at":"2025-07-11T10:30:54.858Z","repository":{"id":39795121,"uuid":"380205794","full_name":"nettitude/RunPE","owner":"nettitude","description":"C# Reflective loader for unmanaged binaries.","archived":false,"fork":false,"pushed_at":"2023-01-25T19:16:18.000Z","size":27,"stargazers_count":397,"open_issues_count":6,"forks_count":62,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-05-08T01:30:52.803Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nettitude.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-25T10:39:12.000Z","updated_at":"2024-05-02T04:48:27.000Z","dependencies_parsed_at":"2023-02-14T10:45:46.094Z","dependency_job_id":null,"html_url":"https://github.com/nettitude/RunPE","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nettitude%2FRunPE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nettitude%2FRunPE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nettitude%2FRunPE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nettitude%2FRunPE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nettitude","download_url":"https://codeload.github.com/nettitude/RunPE/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213939350,"owners_count":15660140,"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":[],"created_at":"2024-08-04T17:01:01.714Z","updated_at":"2024-08-04T17:04:00.635Z","avatar_url":"https://github.com/nettitude.png","language":"C#","funding_links":[],"categories":["C# #"],"sub_categories":[],"readme":"# RunPE\n\nC# reflective loader for unmanaged binaries.\n\n## Usage\n\n```\nUsage: RunPE.exe \u003cfile-to-run\u003e \u003cargs-to-file-to-run\u003e\n        e.g. RunPE.exe C:\\Windows\\System32\\net.exe localgroup administrators\n\nAlternative usage: RunPE.exe ---f \u003cfile-to-pretend-to-be\u003e ---b \u003cbase64 blob of file bytes\u003e ---a \u003cbase64 blob of args\u003e\n        e.g: RunPE.exe ---f C:\\Windows\\System32\\svchost.exe ---b \u003cnet.exe, base64 encoded\u003e ---a \u003clocalgroup administrators, base64 encoded\u003e\n```\n\n\n## Build configuration options\n\nEdit the compilation symbols to quickly adjust the program flow:\n(Right click the project in Visual Studio -\u003e Properties -\u003e Build -\u003e Conditional Compilation Symbols)\n\n* DEBUG (automatically added in Debug release mode) -\u003e Very verbose logging\n* BREAK_TO_ATTACH -\u003e Print \"Press Enter to continue...\" and await input so can attach debugger\n\n\n## PE Compilation Limitations\n\nExecutables launched by RunPE must be statically linked in order for StdOut and \nStdErr redirection to work correctly. To change this setting in Visual Studio:\n\n* Open the project's properties\n* Navigate to `Configuration Properties` -\u003e `C/C++` -\u003e `Code Generation`\n* Change the value of `Runtime Library` to either `Multi-threaded (/MT)`\n  or `Multi-threaded Debug (/MTd)`\n* Recompile the project\n\n## Argument Limitiations\n\nExecutables that do not use the Window's API [CommandLineToArgvW](https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-commandlinetoargvw) in order to parse arguments will not be passed appropriately through RunPE.\nWhen running PE's that the operator has control over compilation, it is suggested to add support for parsing arguments using this API.\n\nFor example, the following code will work when the program is run independently, but will fail when passed to RunPE since `\"foo\"` has been shifted to `argv[2]`:\n\n```c\nif (argv[1] == \"foo\") {\n    bar();\n}\n```\n\nExample for refactoring `argv` to `CommandLineArgvW`:\n\n```c\n#include \u003cstdio.h\u003e\n#include \u003cWindows.h\u003e\n\nint main(int argc, char* argv[]) {\n\tint nArgs;\n\tLPWSTR *szArglist;\n\t\n\tszArglist = CommandLineToArgvW(GetCommandLineW(), \u0026nArgs);\n\n\tfor (int i = 0; i \u003c nArgs; i++) {\n\t\tprintf(\"argv[%d]: %ws\\n\", i, szArglist[i]);\n\t}\n\n\treturn 0;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnettitude%2FRunPE","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnettitude%2FRunPE","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnettitude%2FRunPE/lists"}