Skip to content

Instantly share code, notes, and snippets.

@xpn
Created May 3, 2021 23:09
Show Gist options
  • Save xpn/ebd9497cb47be7e3828458a21a1636c3 to your computer and use it in GitHub Desktop.
Save xpn/ebd9497cb47be7e3828458a21a1636c3 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NautilusProject
{
public class WriteGadget
{
public static void WriteMemory(IntPtr addr, IntPtr value)
{
var mngdRefCustomeMarshaller = typeof(System.String).Assembly.GetType("System.StubHelpers.MngdRefCustomMarshaler");
var CreateMarshaler = mngdRefCustomeMarshaller.GetMethod("CreateMarshaler", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
CreateMarshaler.Invoke(null, new object[] { addr, value });
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment