Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class VAMemoryExtension
- {
- public static long ResolveInt64FromString(this VAMemory memory, string address, char separator = '+')
- {
- var offsets = address.Split(separator);
- long current = Convert.ToInt64(offsets[0]);
- for (int i = 1; i < offsets.Length - 1; i++)
- {
- current = memory.ReadInt64((IntPtr)current + Convert.ToInt32(offsets[i], 16));
- }
- return current + Convert.ToInt32(offsets[offsets.Length - 1], 16);
- }
- public static int ResolveInt32FromString(this VAMemory memory, string address, char separator = '+')
- {
- var offsets = address.Split(separator);
- int current = Convert.ToInt32(offsets[0]);
- for (int i = 1; i < offsets.Length - 1; i++)
- {
- current = memory.ReadInt32((IntPtr)current + Convert.ToInt32(offsets[i], 16));
- }
- return current + Convert.ToInt32(offsets[offsets.Length - 1], 16);
- }
- }
Add Comment
Please, Sign In to add comment