I have done a lot of updating to the memory class, it should all work now and be a lot more efficient and safer to use over previous versions.
Updated Data Type Storage.
Removed Unnecessary Code & Updated Functions.
GetProcess / Module Functions updated.
Removed Some Exception/Error Catching Code As It Was Useless.
And many more small fixes/updates - next time ill write a change-log.
Error Exit/Return Codes:
1 = The Process Could Not Be Found, Make Sure You Have Correctly Name The Process In The Constructor In Source.cpp [ProcMem mem("Process.exe");] Names Are Case Sensitive.
2 = You Are Trying To Grab Information From A (32|64) Bit Application With The Wrong Build - Double Check Your Build.
3 = AOB Scan Failure, You Have Either Got The Wrong Start/End Address Or Bytes Double Check All.
4 = Code Injection Failure - The Default Bytes Must Be More Than 5 [E.G Address Has 2 Bytes, You Must Use The Bytes Of The Next Insctruction(Address) 5 Bytes Away].
5 = Could Not Find Module Name, Check Spelling (Case Sensitive).
7 = Could Not Find '*' Array End Sequence Character
ProcMem mem; //Declare Class Object
DWORD dwBase = mem.Module("process.exe"); //Define Process Base (watch for upper/lower case, the module process.exe is different from the process name Process.exe
DWORD dwServer = mem.Module("server.dll");
//Basic Memory Functions
mem.Read<int>(0x76999A1); //Basic Read Memory (You Must Declare What Type/Size Of Data You Are Reading <short> | <2> etc)
mem.Read<int>(Base+0x3699B); //Process.exe+0x3699B (Using Base)
mem.Write<int>(0x76999A1, 1337); //Basic Write
mem.Write<float>(Base+0x3699B, 13.37); //Example Of Writing A <float>
//Pointer Memory Functions
mem.Read<int>(0x76999A1, "\x2C\x5B\*", true); //Input Offsets In Order As Char* | ATTENTION: MUST ALWAYS Put '*' At The End Of Your Array (true)Returns Value
mem.Read<int>(Base+0x3699B, "\x2C\x5B\*", false); //(false)Returns Address
//Patch Memory Function
mem.Patch(0x76999A1, "\x90\x90\x90\*", "\x4B\x0\x8F\*"); //Input The Bytes You Want To Patch And Also The Default Bytes
mem.Patch(Base+0x3699B, "\x90\x90\x90\*", "\x4B\x0\x8F\*"); //Process.exe+0x3699B (Using Base)
//AOB Scan Function
DWORD dwAOBAddress = mem.AOB_Scan(0x76999A1, 0x76999C1, "\x8B\x3C\x28\xDD\*", true); //Start Scan At Address 0x76999A1 And Read Every Byte From There To 0x76999C1, Looking For Char* Array (Returns Address)
DWORD dwAOBAddress1 = mem.AOB_Scan(Base+0x6999A1, Base+0x6999C1, "\x8B\x3C\x28\xDD\*", false); //false = Returns Address After Searched Bytes
mem.Write<int>(dwAOBAddress, 1337); //Example Of Usage
mem.Write<int>(dwAOBAddress1, 1337); //Example Of Usage
//Code Injection Function (Codecave)
mem.Inject(Base+0x1C8B39, "\xC7\x86\x84\x1\x0\x0\x0\x0\x0\x0\*", "\x89\xBE\x84\x1\x0\x0\*", true); //Input Bytes To Write/Inject Followed By The Default Bytes At The Address (Use CE AA Script To Get Bytes) (true = JMP)
mem.Inject(0x38B39, "\xC7\x86\x84\x1\x0\x0\x0\x0\x0\x0\*", "\x89\xBE\x84\x1\x0\x0\*", false); //Call Jmp Function (false) [Has Not Been Fully Tested]
You may also want to use __int32/64 on reading/writing on 32/64 bit processes for precise memory allocation.
Appreciate all the work you put into these and your willingness to share with the community. Nice work man.
Thanks man, it means a lot for my work to be noticed .
I continue to work on this memory class and keep updating it for the public, I would personally use an internal method if I wanted to create a hack but I know many people want to use external methods and its also very good practice for me.
Soon I hope to add code/functions to the class so your external hacks cant be debugged or picked up by VAC etc with their simple API Reading software to catch external hacks, as I have noticed when debugging my applications in VS sometimes says I cannot accesses the file because another process is using it, and its only when I close steam im able to debug it again.
But yeah receiving feedback really helps motivate me to carry on working on it, so thanks again
Soon I will release a custom vector (Vec3) class that you can use both internally and externally to calculate distances and angles to make it easier to create ESP/Aim-Bots