daily pastebin goal
8%
SHARE
TWEET

Untitled

TKGP Mar 23rd, 2018 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using Binarysharp.MemoryManagement;
  2. using System;
  3.  
  4. namespace ur_mom_lole
  5. {
  6.     static class MemorySharpExtensions
  7.     {
  8.         public static T Read<T>(this MemorySharp ms, int address)
  9.         {
  10.             return ms.Read<T>((IntPtr)address, false);
  11.         }
  12.  
  13.         public static void Write<T>(this MemorySharp ms, int address, T value)
  14.         {
  15.             ms.Write((IntPtr)address, value, false);
  16.         }
  17.  
  18.         public static bool ReadFlag32(this MemorySharp ms, int address, uint mask)
  19.         {
  20.             uint flags = ms.Read<UInt32>(address);
  21.             return (flags & mask) != 0;
  22.         }
  23.  
  24.         public static void WriteFlag32(this MemorySharp ms, int address, uint mask, bool enable)
  25.         {
  26.             uint flags = ms.Read<UInt32>(address);
  27.             if (enable)
  28.                 flags |= mask;
  29.             else
  30.                 flags &= ~mask;
  31.             ms.Write(address, flags);
  32.         }
  33.     }
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top