Netwide Assembler
The Netwide Assembler (NASM) is a popular assembler program used for writing x86 and x86-64 assembly language code. It is known for its portability, flexibility, and compatibility.
Last updated
The Netwide Assembler (NASM) is a popular assembler program used for writing x86 and x86-64 assembly language code. It is known for its portability, flexibility, and compatibility.
Last updated
del shellcode.obj
del shellcode.exe
nasm -f win64 shellcode.asm -o shellcode.obj
link /ENTRY:main /MACHINE:X64 /NODEFAULTLIB /SUBSYSTEM:CONSOLE shellcode.objnasm -f bin -o shellcode.bin shellcode.asm
Hex2.exe .\shellcode.binstatic void Main(string[] args)
{
byte[] file = System.IO.File.ReadAllBytes(args[0]);
StringBuilder sb = new StringBuilder();
sb.Append("const unsigned char shellcode[] = {");
string hex = BitConverter.ToString(file).Replace("-", ", 0x");
hex = "0x" + hex;
sb.Append(hex);
sb.Append("};");
Console.WriteLine(sb.ToString());
}