So, hi first...i did make an account here too, after seeing this lib on ownedcore forum .
I really like your work here...and the integration with vs2013...no words .
I just have an old code made from here and there and i want to port everything.
I will try not to bother to much but i am still newbie with c#...and this lib is quite impressive for me.
To the point ...first thing first :
1: - Is really necessary to use 2 times OpenProcess...for Open & GetBaseAddress ?
2: - What does this ".First" and what are the access rights when opening a process? // found the answer in the library
3: - Where can i write the Allocate/Dealc function exactly...there are many ways as i see...?
public static void OpenProcess() { using (var memory = new MemorySharp(ApplicationFinder.FromProcessName("Game.exe").First())) { var open = memory.Modules.RemoteModules.First().BaseAddress; MessageBox.Show("address : " + open.ToString("X")); } } public static void GetBaseAddress() { using (var memory = new MemorySharp(ApplicationFinder.FromProcessName("Game.exe").First())) { var gameBase = memory.Modules.RemoteModules.First(m => m.Name == "Game.dll").BaseAddress; var atkBase = gameBase + 0x18A73D; MessageBox.Show("atkBase : " + atkBase.ToString("X")); } }
// Old Code public static void allocate(out int vMemory, int nSize) { vMemory = VirtualAllocEx(m_hProcess, IntPtr.Zero, nSize, AllocType.Commit, Protect.ExecuteReadWrite); } public static bool dealloc(int vMemory) { return VirtualFreeEx(m_hProcess, (IntPtr)vMemory, 0, FreeType.Release); } }
Oh i forgot.. if there is no process..i get an error...how do i prevent that ?
Thank you,
Edited by vmv, 18 November 2013 - 12:17 PM.