MemConnecting Method 1
MemConnecting Method 1
using Beyondmem;
-----------public initialize-------------
GetProcID(1);
Proctimer = new System.Timers.Timer();
Proctimer.Interval = 15000;
Proctimer.Elapsed += findproc;
Proctimer.AutoReset = true;
//Timer Starter.................
[DllImport("user32.dll")]
public static extern uint SetWindowDisplayAffinity(IntPtr hwnd, uint dwAffinity);
[DllImport("KERNEL32.DLL")]
public static extern IntPtr CreateToolhelp32Snapshot(uint flags, uint processid);
[DllImport("KERNEL32.DLL")]
public static extern int Process32First(IntPtr handle, ref ProcessEntry32 pe);
[DllImport("KERNEL32.DLL")]
public static extern int Process32Next(IntPtr handle, ref ProcessEntry32 pe);
private static string info;
#region Change Mem
public static async Task ChangeMem(string original, string replace, string mode)
{
info = "0";
if (PID == null || Convert.ToInt32(PID) == 0)
{
info = "1";
return;
}
IEnumerable<long> scanmem;
try
{
MemLib.OpenProcess(Convert.ToInt32(PID));
scanmem = await MemLib.AoBScan(0L, 140737488355327L, original, true,
true);
}
catch
{
info = "4";
return;
}
if (scanmem.Count() == 0)
{
info = "3";
return;
}
if (mode == "1")
{
info = "2";
}
else if (mode == "0")
{
info = "-2";
}
}
#endregion
public static MemMirza MemLib = new MemMirza();
private async void findproc(Object source, System.Timers.ElapsedEventArgs e)
{
if (Convert.ToInt32(PID) == 0)
{
hook.Text = "Hook : PID - False {" + PID + "}";
GetProcID(1);
}
else
{
hook.Text = "Hook : PID - True {" + PID + "}";
}
GetProcID(1);
}
if (processEntry2.szExeFile.Contains("HD-Player") &&
processEntry2.cntThreads > num)
{
num = processEntry2.cntThreads;
intPtr = (IntPtr)((long)
(unchecked((ulong)processEntry2.th32ProcessID)));
}
if (processEntry2.szExeFile.Contains("HD-Player.exe") &&
processEntry2.cntThreads > num)
{
num = processEntry2.cntThreads;
intPtr = (IntPtr)((long)
(unchecked((ulong)processEntry2.th32ProcessID)));
}
if (processEntry2.szExeFile.Contains("AndroidProcess") &&
processEntry2.cntThreads > num)
{
num = processEntry2.cntThreads;
intPtr = (IntPtr)((long)
(unchecked((ulong)processEntry2.th32ProcessID)));
}
if (processEntry2.szExeFile.Contains("LdVBoxHeadless") &&
processEntry2.cntThreads > num)
{
num = processEntry2.cntThreads;
intPtr = (IntPtr)((long)
(unchecked((ulong)processEntry2.th32ProcessID)));
}
if (processEntry2.szExeFile.Contains("MEmuHeadless") &&
processEntry2.cntThreads > num)
{
num = processEntry2.cntThreads;
intPtr = (IntPtr)((long)
(unchecked((ulong)processEntry2.th32ProcessID)));
}
if (processEntry2.szExeFile.Contains("NoxVMHandle") &&
processEntry2.cntThreads > num)
{
num = processEntry2.cntThreads;
intPtr = (IntPtr)((long)
(unchecked((ulong)processEntry2.th32ProcessID)));
}
if (processEntry2.szExeFile.Contains("aow_exe") &&
processEntry2.cntThreads > num)
{
num = processEntry2.cntThreads;
intPtr = (IntPtr)((long)
(unchecked((ulong)processEntry2.th32ProcessID)));
}
}
}
result = Convert.ToString(intPtr);
PID = Convert.ToString(intPtr);
}
return result;
}
}
public struct ProcessEntry32
{
public uint dwSize;
public uint cntUsage;
public uint th32ProcessID;
public IntPtr th32DefaultHealabel1;
public uint th32ModuleID;
public uint cntThreads;
public uint th32ParentProcessID;
public int pcPriClassBase;
public uint dwFlags;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string szExeFile;
}
-----------------Timer Connecting--------------
if (info == "0")
{
status.ForeColor = Color.YellowGreen;
status.Text = "Wait For Apply";
}
else if (info == "1")
{
status.ForeColor = Color.Red;
status.Text = "No Emulator Found";
}
else if (info == "-2")
{
status.Text = "YOUR HACK DEACTIVE!";
}
else if (info == "2")
{
status.Text = "YOUR HACK ACTIVE!";
}
else if (info == "3")
{
status.Text = "Maybe Already Applied Or Nothing Found";
}
else if (info == "4")
{
status.Text = "Wrong PID Please Refresh";
}
--------------------fORM load------------
Proctimer.Enabled = true;