Skip to content
/ sc2pe Public

Simple dotnet Native AOT app that uses AsmResolver to convert shellcode to PE

Notifications You must be signed in to change notification settings

Dump-GUY/sc2pe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

sc2pe

Simple dotnet Native AOT app that uses [AsmResolver] to convert shellcode to PE.
Both 32-bit and 64-bit (x86, x64) shellcode is supported -> resulting in 32-bit or 64-bit PE.
[Releases] are compiled for both linux-x64 and win-x64.

Description

It is compiled to Native AOT format to demonstrate how awesome it is (still, it was a pain as some dependency uses reflection that gets trimmed if we won't trick it :D). The [release] binaries available to download are native binaries without any dotnet dependency! (so just run and enjoy)

Native AOT compiled, using dotnet SDK 8.0.100-preview.3.23178.7
Dotnet SDK 8+ was chosen because of producing much smaller binaries.

Native AOT compilation is supported from the dotnet 7 version. If you want to use dotnet 7 for building, modify the project file to target net7.0 -> building is much easier for dotnet 7.

Building on Windows using dotnet SDK 8+:

Pretty easy:

  • Install or update to the latest Visual Studio (preview).
  • Install dotnet 8+ SDK.
  • Open .sln and restore nugets (AsmResolver.PE, CommandLineParser) -> should be automatic if you configured the nuget URL.
  • VS Terminale - "dotnet publish -r win-x64 -c Release"

Building on Linux using dotnet SDK 8+:

  • I don't wanna talk about it; just use the release binaries :) (as dotnet SDK 8+ is not available via the package manager, it is a pain in the ass)

Usage

-p, --path [Required. Path to shellcode file]

-a, --architecture [Required. Architecture: 32 or 64 (depending on the shellcode)]

-o, --offset [Optional. Start offset of the shellcode (default 0)]

--help [Display this help screen]

--version [Display version information]

Example

Convert shellcode to 32-bit PE (shellcode Start Offset set to 66th byte):
sc2pe -a 32 -o 66 -p C:\shellcode.bin

About

Simple dotnet Native AOT app that uses AsmResolver to convert shellcode to PE

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages