Skip to content

Instantly share code, notes, and snippets.

@tophertimzen
Created June 12, 2015 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tophertimzen/1da2b0aab6245ed1c27b to your computer and use it in GitHub Desktop.
Save tophertimzen/1da2b0aab6245ed1c27b to your computer and use it in GitHub Desktop.
public static object GetInstance(IntPtr ptrIN)
{
object refer = ptrIN.GetType();
IntPtr pointer = ptrIN;
unsafe
{
*(&pointer - 1) = *(&pointer);
}
return refer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment