var code = new byte[64];
var stream = new MemoryStream(code);
var writer = new BinaryWriter(stream);
var codePtr = VirtualAlloc(IntPtr.Zero, code.Length, 0x1000, 0x40);
// (B8) mov eax, <32 bit int>
writer.Write((Byte)0xB8);
writer.Write(12);
// (C3) retn
writer.Write((Byte)0xC3);
Marshal.Copy(code, 0, codePtr, code.Length);
var inlineBindNative = (InlineBindNative)Marshal.GetDelegateForFunctionPointer(codePtr, typeof(InlineBindNative));
MessageBox.Show(inlineBindNative().ToString());
VirtualFree(codePtr, code.Length, 0x8000);