From 9442848e318ebb0924fd7880d0196514b27519ab Mon Sep 17 00:00:00 2001 From: krystalgamer Date: Tue, 12 Jul 2016 11:50:59 +0100 Subject: [PATCH 1/8] Delete Common.h --- Common.h | 136 ------------------------------------------------------- 1 file changed, 136 deletions(-) delete mode 100644 Common.h diff --git a/Common.h b/Common.h deleted file mode 100644 index e7d1194..0000000 --- a/Common.h +++ /dev/null @@ -1,136 +0,0 @@ -/// Common.h -// Defines common used libraries/headers across project files -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -// Add here headers - -// Quick macros :+) -#define FATAL_ERROR(ERROR) (MessageBox(NULL, ERROR, "FATAL ERROR", MB_ICONSTOP|MB_OK)) -#define SEPARATOR() (printf("$---------------------------------$\n")) -#define COLOR(COL) (SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), COL)) - -// Quick funcs :+) -void ClearScreen() -{ - CONSOLE_SCREEN_BUFFER_INFO csbi; - HANDLE hStdOut; - DWORD count; - DWORD cellCount; - COORD homeCoords = { 0, 0 }; - - hStdOut = GetStdHandle( STD_OUTPUT_HANDLE ); - if( hStdOut == INVALID_HANDLE_VALUE ) return; - - if( !GetConsoleScreenBufferInfo( hStdOut, &csbi ) ) return; - cellCount = csbi.dwSize.X *csbi.dwSize.Y; - - if( !FillConsoleOutputCharacter( hStdOut, ( TCHAR ) ' ', cellCount, homeCoords, &count ) ) - return; - - if( !FillConsoleOutputAttribute( hStdOut, csbi.wAttributes, cellCount, homeCoords, &count ) ) - return; - SetConsoleCursorPosition( hStdOut, homeCoords ); -} -std::string ExePath() -{ - char buffer[MAX_PATH]; - GetModuleFileName( NULL, buffer, MAX_PATH ); - std::string::size_type pos = std::string( buffer ).find_last_of( "\\/" ); - return std::string( buffer ).substr( 0, pos); -} -void HideCursor() -{ - CONSOLE_CURSOR_INFO CurInfo = { 1, false }; - SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &CurInfo); -} -bool FileExists(std::string Path) -{ - struct stat buffer; - return (stat (Path.c_str(), &buffer) == 0); -} - -// Quick enums :+) -enum ConCol -{ - black = 0, - dark_blue = 1, - dark_green = 2, - dark_aqua, dark_cyan = 3, - dark_red = 4, - dark_purple = 5, dark_pink = 5, dark_magenta = 5, - dark_yellow = 6, - dark_white = 7, - gray = 8, - blue = 9, - green = 10, - aqua = 11, cyan = 11, - red = 12, - purple = 13, pink = 13, magenta = 13, - yellow = 14, - white = 15 -}; -enum WeaponIDI -{ - WEAPON_DEAGLE = 1, - WEAPON_ELITE = 2, - WEAPON_FIVESEVEN = 3, - WEAPON_GLOCK = 4, - WEAPON_AK47 = 7, - WEAPON_AUG = 8, - WEAPON_AWP = 9, - WEAPON_FAMAS = 10, - WEAPON_G3SG1 = 11, - WEAPON_GALILAR = 13, - WEAPON_M249 = 14, - WEAPON_M4A4 = 16, - WEAPON_MAC10 = 17, - WEAPON_P90 = 19, - WEAPON_UMP45 = 24, - WEAPON_XM1014 = 25, - WEAPON_BIZON = 26, - WEAPON_MAG7 = 27, - WEAPON_NEGEV = 28, - WEAPON_SAWEDOFF = 29, - WEAPON_TEC9 = 30, - WEAPON_TASER = 31, - WEAPON_HKP2000 = 32, - WEAPON_MP7 = 33, - WEAPON_MP9 = 34, - WEAPON_NOVA = 35, - WEAPON_P250 = 36, - WEAPON_SCAR20 = 38, - WEAPON_SG556 = 39, - WEAPON_SSG08 = 40, - WEAPON_KNIFE = 42, - WEAPON_FLASHBANG = 43, - WEAPON_HEGRENADE = 44, - WEAPON_SMOKEGRENADE = 45, - WEAPON_MOLOTOV = 46, - WEAPON_DECOY = 47, - WEAPON_INCGRENADE = 48, - WEAPON_C4 = 49, - WEAPON_KNIFE_T = 59, - WEAPON_M4A1_SILENCER = 60, - WEAPON_USP_SILENCER = 61, - WEAPON_CZ75A = 63, - WEAPON_REVOLVER = 64, - WEAPON_KNIFE_BAYONET = 500, - WEAPON_KNIFE_FLIP = 505, - WEAPON_KNIFE_GUT = 506, - WEAPON_KNIFE_KARAMBIT = 507, - WEAPON_KNIFE_M9_BAYONET = 508, - WEAPON_KNIFE_TACTICAL = 509, - WEAPON_KNIFE_FALCHION = 512, - WEAPON_KNIFE_BOWIE = 514, - WEAPON_KNIFE_BUTTERFLY = 515, - WEAPON_KNIFE_PUSH = 516 -}; \ No newline at end of file From 0bc3dba998a04cc689ed30f0eb85e589ad5ffedb Mon Sep 17 00:00:00 2001 From: krystalgamer Date: Tue, 12 Jul 2016 11:51:09 +0100 Subject: [PATCH 2/8] Delete main.cpp --- main.cpp | 255 ------------------------------------------------------- 1 file changed, 255 deletions(-) delete mode 100644 main.cpp diff --git a/main.cpp b/main.cpp deleted file mode 100644 index 80b2774..0000000 --- a/main.cpp +++ /dev/null @@ -1,255 +0,0 @@ -/// main.cpp -// Entry point for the cheat -#include "Common.h" -#include "Memory.h" -#include "PatternScan.h" -#include "IniParser.h" - -using std::hex; -using std::dec; -using std::uppercase; -using std::nouppercase; -using std::cout; -using std::endl; // I'm lazy huh? - -// Declare here the externed stuff (yeah I didn't do .h/.cpp because I'm a jerk hehe :DD) -std::unique_ptr CSMemory = std::unique_ptr(new CMemoryManager()); -std::unique_ptr ClientScanner; -std::unique_ptr EngineScanner; -CIniParser* IniParser = new CIniParser(); - -// Patterns & Masks here -// Patterns by Y3t1Y3t and WasserEsser!!! -BYTE pt_LocalPlayer [] = { 0xA3, 0x00, 0x00, 0x00, 0x00, 0xC7, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x59, 0xC3, 0x6A }; // + 0x1 ] - ClientBase + 0x10 ) -const char* msk_LocalPlayer = "x????xx????????x????xxx"; -BYTE pt_EntityList [] = { 0xBB, 0x00, 0x00, 0x00, 0x00, 0x83, 0xFF, 0x01, 0x0F, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x3B, 0xF8 }; // + 0x1 ] -const char* msk_EntityList = "x????xxxxx????xx"; -BYTE pt_EnginePointer [] = { 0xA1, 0x00, 0x00, 0x00, 0x00, 0xF3, 0x0F, 0x11, 0x80, 0x00, 0x00, 0x00, 0x00, 0xD9, 0x46, 0x04, 0xD9, 0x05 }; // + 0x1 ] -const char* msk_EnginePointer = "x????xxxx????xxxxx"; -BYTE pt_ForceFullUpdate [] = { 0xB0, 0xFF, 0xB7, 0x00, 0x00, 0x00, 0x00, 0xE8 }; // + 0x3 ] -const char* msk_ForceFullUpdate = "xxx????x"; - -// Offsets declaration here -DWORD m_dwLocalPlayer; -DWORD m_dwEntityList; -DWORD m_dwEnginePointer; -DWORD m_dwForceFullUpdate; - -void FindOffsets() -{ - // Exactly, Wasser, I'm subtracting le bases uselessly :^)))) - m_dwLocalPlayer = CSMemory->Read(ClientScanner->FindPattern(pt_LocalPlayer, msk_LocalPlayer) + 0x1) - CSMemory->GetClientBase() + 0x10; - m_dwEntityList = CSMemory->Read(ClientScanner->FindPattern(pt_EntityList, msk_EntityList) + 0x1) - CSMemory->GetClientBase(); - m_dwEnginePointer = CSMemory->Read(EngineScanner->FindPattern(pt_EnginePointer, msk_EnginePointer) + 0x1) - CSMemory->GetEngineBase(); - m_dwForceFullUpdate = CSMemory->Read(EngineScanner->FindPattern(pt_ForceFullUpdate, msk_ForceFullUpdate) + 0x3); -} -void PrintOffsets() -{ - cout << "OFFSETS:" << endl; - cout << "m_dwLocalPlayer -> 0x" << hex << uppercase << m_dwLocalPlayer << dec << nouppercase << endl; - cout << "m_dwEntityList -> 0x" << hex << uppercase << m_dwEntityList << dec << nouppercase << endl; - cout << "m_dwEnginePointer -> 0x" << hex << uppercase << m_dwEnginePointer << dec << nouppercase << endl; - cout << "m_dwForceFullUpdate -> 0x" << hex << uppercase << m_dwForceFullUpdate << dec << nouppercase << endl; -} - -// Netvars here -DWORD m_hActiveWeapon = 0x2EE8; -DWORD m_hMyWeapons = 0x2DE8; -DWORD m_iItemDefinitionIndex = 0x2F88; -DWORD m_iAccountID = 0x2FA8; -DWORD m_OriginalOwnerXuidLow = 0x3160; -DWORD m_OriginalOwnerXuidHigh = 0x3164; -DWORD m_iItemIDLow = 0x2FA4; -DWORD m_iItemIDHigh = 0x2FA0; -DWORD m_nFallbackPaintKit = 0x3168; -DWORD m_nFallbackSeed = 0x316C; -DWORD m_flFallbackWear = 0x3170; -DWORD m_nFallbackStatTrak = 0x3174; -DWORD m_iEntityQuality = 0x2F8C; -DWORD m_szCustomName = 0x301C; - -// Funcs here -void WelcomeScreen() -{ - ClearScreen(); - cout << "---- $$$ WELCOME TO EZSKINZ $$$ ---" << endl; - cout << "|| [ F1 ] Set skins ||" << endl; - cout << "|| [ F2 ] Print Config path ||" << endl; - cout << "|| [ F3 ] Print instructions ||" << endl; - cout << "|| [ F4 ] Close Cheat ||" << endl; - cout << "-----------------------------------" << endl; - cout << "|| Made by Double V for UnknownCheats.me" << endl; - cout << "|| Credits to WasserEsser & Y3t1Y3t for signatures" << endl; - cout << "-----------------------------------" << endl; - cout << "Console Log:" << endl; -} - -void ForceFullUpdate() -{ - DWORD EnginePointer = CSMemory->Read(CSMemory->GetEngineBase() + m_dwEnginePointer); - CSMemory->Write(EnginePointer + m_dwForceFullUpdate, -1); -} - -struct Skin_t -{ - int PaintKit; - int Seed; - int StatTrak; - int EntityQuality; - char* CustomName; - float Wear; - - Skin_t() - { - PaintKit = 0; - Seed = 0; - StatTrak = -1; - EntityQuality = 4; - CustomName = nullptr; - Wear = 0.01f; - } - - Skin_t(int PaintKit, int Seed, int StatTrak, int EntityQuality, char* CustomName, float Wear) - { - this->PaintKit = PaintKit; - this->Seed = Seed; - this->StatTrak = StatTrak; - this->EntityQuality = EntityQuality; - this->CustomName = CustomName; - this->Wear = Wear; - } -}; - -void WriteSkinConfig(int WeaponId, Skin_t Config) -{ - IniParser->WriteInt(std::to_string(WeaponId).c_str(), "PaintKit", Config.PaintKit); - IniParser->WriteInt(std::to_string(WeaponId).c_str(), "Seed", Config.Seed); - IniParser->WriteInt(std::to_string(WeaponId).c_str(), "StatTrak", Config.StatTrak); - IniParser->WriteInt(std::to_string(WeaponId).c_str(), "EntityQuality", Config.EntityQuality); - IniParser->Write(std::to_string(WeaponId).c_str(), "CustomName", Config.CustomName); - IniParser->WriteFloat(std::to_string(WeaponId).c_str(), "Wear", Config.Wear); -} - -// Main entry point -int main() -{ - SetConsoleTitle("$$ EZSKINZ BY DOUBLE V $$"); - HideCursor(); - COLOR(yellow); - IniParser->szFile = ExePath() + "\\Config.ini"; - - if (!FileExists(IniParser->szFile)) - { - // write dummy ak config just to generate ini file - WriteSkinConfig(7, Skin_t(180, 0, 1337, 1, "Fire Shit", 0.001f)); - } - - if (!CSMemory->AttachProcess("csgo.exe")) - { - FATAL_ERROR("CS:GO not found!"); - return 0; - } - - // Spit out debug infos - SEPARATOR(); - cout << "CS:GO found!" << endl; - cout << "Handle value -> " << hex << uppercase << *CSMemory->GetHandle() << dec << nouppercase << endl; - cout << "ProcessID -> " << hex << uppercase << CSMemory->GetProcessId() << dec << nouppercase << endl; - - if (!CSMemory->GetModule("client.dll")) - { - FATAL_ERROR("Client.dll not found!"); - return 0; - } - - // Spit out more debug infos about client.dll - SEPARATOR(); - cout << "Client.dll found!" << endl; - cout << "Base Address -> " << hex << uppercase << CSMemory->GetClientBase() << dec << nouppercase << endl; - cout << "Module Size -> " << CSMemory->GetClientSize() << " bytes"<< endl; - - if (!CSMemory->GetModule("engine.dll")) - { - FATAL_ERROR("Engine.dll not found!"); - return 0; - } - - // Spit out more debug infos about engine.dll - SEPARATOR(); - cout << "Engine.dll found!" << endl; - cout << "Base Address -> " << hex << uppercase << CSMemory->GetEngineBase() << dec << nouppercase << endl; - cout << "Module Size -> " << CSMemory->GetEngineSize() << " bytes"<< endl; - - ClientScanner = std::unique_ptr(new CPatternScanner(CSMemory->GetHandle(), CSMemory->GetClient())); - EngineScanner = std::unique_ptr(new CPatternScanner(CSMemory->GetHandle(), CSMemory->GetEngine())); - - if (!ClientScanner->Dump()) - { - FATAL_ERROR("Failed to dump client.dll!"); - return 0; - } - if (!EngineScanner->Dump()) - { - FATAL_ERROR("Failed to dump engine.dll!"); - return 0; - } - - SEPARATOR(); - FindOffsets(); - PrintOffsets(); - SEPARATOR(); - cout << "Debug ended, 3 secs and I launch the cheat :^)" << endl; - SEPARATOR(); - - std::this_thread::sleep_for(std::chrono::seconds(3)); - - WelcomeScreen(); - - while (!GetAsyncKeyState(VK_F4)) - { - DWORD LocalPlayer = CSMemory->Read(CSMemory->GetClientBase() + m_dwLocalPlayer); - - // Thanks a lot WasserEsser for cleaning my mind about m_hMyWeapons... you are my hero :^) - for (int i=0; i<48; i++) - { - DWORD CurrentWeaponIndex = CSMemory->Read(LocalPlayer + m_hMyWeapons + ((i - 1) * 0x4)) & 0xFFF; - DWORD CurrentWeaponEntity = CSMemory->Read(CSMemory->GetClientBase() + m_dwEntityList + (CurrentWeaponIndex - 1) * 0x10); - int CurrentWeaponId = CSMemory->Read(CurrentWeaponEntity + m_iItemDefinitionIndex); - int MyXuid = CSMemory->Read(CurrentWeaponEntity + m_OriginalOwnerXuidLow); - CSMemory->Write(CurrentWeaponEntity + m_iItemIDLow, 2048); // Hehe - CSMemory->Write(CurrentWeaponEntity + m_iItemIDHigh, 0); - if (IniParser->SectionExists(std::to_string(CurrentWeaponId).c_str())) - { - CSMemory->Write(CurrentWeaponEntity + m_nFallbackPaintKit, IniParser->ReadInt(std::to_string(CurrentWeaponId).c_str(), "PaintKit")); - CSMemory->Write(CurrentWeaponEntity + m_nFallbackSeed, IniParser->ReadInt(std::to_string(CurrentWeaponId).c_str(), "Seed")); - CSMemory->Write(CurrentWeaponEntity + m_nFallbackStatTrak, IniParser->ReadInt(std::to_string(CurrentWeaponId).c_str(), "StatTrak")); - CSMemory->Write(CurrentWeaponEntity + m_iEntityQuality, IniParser->ReadInt(std::to_string(CurrentWeaponId).c_str(), "EntityQuality")); - CSMemory->WriteArray(CurrentWeaponEntity + m_szCustomName, IniParser->ReadString(std::to_string(CurrentWeaponId).c_str(), "CustomName").c_str(), IniParser->ReadString(std::to_string(CurrentWeaponId).c_str(), "CustomName").length()); - CSMemory->Write(CurrentWeaponEntity + m_flFallbackWear, IniParser->ReadFloat(std::to_string(CurrentWeaponId).c_str(), "Wear")); - } - CSMemory->Write(CurrentWeaponEntity + m_iAccountID, MyXuid); - } - - if (GetAsyncKeyState(VK_F1)) - ForceFullUpdate(); - - if (GetAsyncKeyState(VK_F2)) - { - cout << "The Config Path is:" << endl << IniParser->szFile << endl; - std::this_thread::sleep_for(std::chrono::milliseconds(250)); - } - - if (GetAsyncKeyState(VK_F3)) - { - cout << "Set the skins through the config.ini file" << endl; - cout << "Then, press F1 while in game to set the skins" << endl; - std::this_thread::sleep_for(std::chrono::milliseconds(250)); - } - - std::this_thread::sleep_for(std::chrono::seconds(1)); - } - - // Clean le stuffz out - CSMemory->Close(); // Close handle to CS:GO - return 0; -} From 521e2faaeeba69a559dc0deaaf65a65a1b05c61d Mon Sep 17 00:00:00 2001 From: krystalgamer Date: Tue, 12 Jul 2016 11:51:18 +0100 Subject: [PATCH 3/8] Delete README.md --- README.md | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index 5535017..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# EzSkinzNEW - -UC Thread: http://www.unknowncheats.me/forum/counterstrike-global-offensive/182248-source-ezskinz-external-skinchanger-flexible-customizable.html#post1502661 From b4d7b53ab57b6f6cfdc8ea7014feabb85b8a2e72 Mon Sep 17 00:00:00 2001 From: krystalgamer Date: Tue, 12 Jul 2016 11:51:27 +0100 Subject: [PATCH 4/8] Delete PatternScan.h --- PatternScan.h | 71 --------------------------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 PatternScan.h diff --git a/PatternScan.h b/PatternScan.h deleted file mode 100644 index 56f7062..0000000 --- a/PatternScan.h +++ /dev/null @@ -1,71 +0,0 @@ -/// PatternScan.h -// Defines a quick class to perform pattern scanning on client and engine modulez -#pragma once -#include "Common.h" - -class CPatternScanner -{ -private: - - HANDLE* m_hProcessToScan; - MODULEENTRY32 m_ModuleToScan; - BYTE* m_DumpedRegion; // WasserEsser don't hate me but I can't get this shit working completely with std::unique_ptr :^) I've tried tho - DWORD m_dwModuleBase; - DWORD m_dwModuleSize; - -public: - - CPatternScanner(HANDLE* ProcessToScan, MODULEENTRY32 ModuleToScan) - : m_hProcessToScan(ProcessToScan), - m_ModuleToScan(ModuleToScan), - m_dwModuleBase((DWORD)ModuleToScan.modBaseAddr), - m_dwModuleSize(ModuleToScan.modBaseSize) - { - } - ~CPatternScanner() - { - Clean(); - } - - bool Dump() - { - m_DumpedRegion = new BYTE[m_dwModuleSize]; - - if (ReadProcessMemory(*m_hProcessToScan, (LPVOID)m_dwModuleBase, m_DumpedRegion, m_dwModuleSize, NULL) == FALSE) - return false; - - return true; - } - bool MaskCheck(int iStartOffset, const BYTE* byPattern, const char* szMask) - { - for (unsigned int i=0; im_DumpedRegion[iStartOffset + i]) - return false; - } - return true; - } - DWORD FindPattern(const BYTE* byPattern, const char* szMask, DWORD iAddValue = 0, bool bSubtractBase = false) - { - if (this->m_DumpedRegion==nullptr) if (!this->Dump()) return NULL; - - for (DWORD i=0; i < this->m_dwModuleBase + this->m_dwModuleSize; i++) - { - if (this->MaskCheck(i, byPattern, szMask)) - return bSubtractBase ? i + iAddValue : this->m_dwModuleBase + i + iAddValue; - } - - return NULL; - } - - void Clean() - { - delete [] m_DumpedRegion; - nullptr; - } - -}; - -extern std::unique_ptr ClientScanner; -extern std::unique_ptr EngineScanner; \ No newline at end of file From 5be716e8aa27986712bde941e3f1c8103ca692e0 Mon Sep 17 00:00:00 2001 From: krystalgamer Date: Tue, 12 Jul 2016 11:51:34 +0100 Subject: [PATCH 5/8] Delete IniParser.h --- IniParser.h | 89 ----------------------------------------------------- 1 file changed, 89 deletions(-) delete mode 100644 IniParser.h diff --git a/IniParser.h b/IniParser.h deleted file mode 100644 index e4988c9..0000000 --- a/IniParser.h +++ /dev/null @@ -1,89 +0,0 @@ -/// IniParser.h -// Defines quick class to parse ini files with win api -#pragma once -#include "Common.h" -#pragma warning(disable:4800) - -// Creds: TeamGamerFood, maybe? Can't remember exactly - -class CIniParser -{ -public: - - std::string szFile; - - std::string ReadString(const char* szSection, const char* szKey) - { - char szTemp[128]; - if (GetPrivateProfileStringA(szSection, szKey, "", szTemp, 128, szFile.c_str())) - { - char szString[128]; - sprintf(szString, szTemp); - return std::string(szString); - } - return nullptr; - } - - int ReadInt(const char* szSection, const char* szKey) - { - char szTemp[128]; - if (GetPrivateProfileStringA(szSection, szKey, "", szTemp, 128, szFile.c_str())) - { - char szString[128]; - sprintf(szString, szTemp); - - return std::stoi(szString); - } - return -1; - } - - bool ReadBool(const char* szSection, const char* szKey) - { - char szTemp[128]; - if (GetPrivateProfileStringA(szSection, szKey, "", szTemp, 128, szFile.c_str())) - { - char szString[128]; - sprintf(szString, szTemp); - return std::stoi(szString); - } - return false; - } - - float ReadFloat(const char* szSection, const char* szKey) - { - char szTemp[128]; - if (GetPrivateProfileStringA(szSection, szKey, "", szTemp, 128, szFile.c_str())) - { - char szString[128]; - sprintf(szString, szTemp); - - return std::stof(szString); - } - return -1.f; - } - - void Write(const char* szSection, const char* szKey, const char* szValue) - { - WritePrivateProfileStringA(szSection, szKey, szValue, szFile.c_str()); - } - - void WriteInt(const char* szSection, const char* szKey, int szValue) - { - WritePrivateProfileStringA(szSection, szKey, std::to_string(szValue).c_str(), szFile.c_str()); - } - - void WriteFloat(const char* szSection, const char* szKey, float szValue) - { - WritePrivateProfileStringA(szSection, szKey, std::to_string(szValue).c_str(), szFile.c_str()); - } - - bool SectionExists(const char* szSection) - { - char result[100]; - long lRetValue = GetPrivateProfileString(szSection, NULL, "", result, 90, szFile.c_str()); - return (lRetValue > 0); - } - -}; - -extern CIniParser* IniParser; \ No newline at end of file From 31110111fa18422f32e6e8b172816d3e42e392fd Mon Sep 17 00:00:00 2001 From: krystalgamer Date: Tue, 12 Jul 2016 11:51:44 +0100 Subject: [PATCH 6/8] Delete Memory.h --- Memory.h | 159 ------------------------------------------------------- 1 file changed, 159 deletions(-) delete mode 100644 Memory.h diff --git a/Memory.h b/Memory.h deleted file mode 100644 index b63b547..0000000 --- a/Memory.h +++ /dev/null @@ -1,159 +0,0 @@ -/// Memory.h -// Defines a quick class to better manage CS:GO memory externally -#pragma once -#include "Common.h" - -class CMemoryManager -{ -private: - - HANDLE m_hProcess; - DWORD m_dwProcessID; - MODULEENTRY32 m_Client; - MODULEENTRY32 m_Engine; - -public: - - bool AttachProcess(const std::string& strProcessName) - { - HANDLE hPID = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); - if (hPID == INVALID_HANDLE_VALUE) return false; - - PROCESSENTRY32 ProcEntry; - ProcEntry.dwSize = sizeof(PROCESSENTRY32); - - // Mabye there should be a Process32First call here? hue - - do - if (!strcmp(ProcEntry.szExeFile, strProcessName.c_str())) - { - this->m_dwProcessID = ProcEntry.th32ProcessID; - CloseHandle(hPID); - this->m_hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, ProcEntry.th32ProcessID); - return true; - } - while (Process32Next(hPID, &ProcEntry)); - - CloseHandle(hPID); - return false; - } - bool GetModule(const std::string& strModuleName) - { - // Kk, I filter to get only client.dll and engine.dll, this is shit ikr but I only need those 2 modules - if (strModuleName != "client.dll" && strModuleName != "engine.dll") - return false; - - HANDLE hModule = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, this->m_dwProcessID); - if (hModule == INVALID_HANDLE_VALUE) return false; - - MODULEENTRY32 ModEntry; - ModEntry.dwSize = sizeof(MODULEENTRY32); - - // Maybe there should be a Module32First call here? hue - - do - if (!strcmp(ModEntry.szModule, strModuleName.c_str())) - { - CloseHandle(hModule); - (strModuleName == "client.dll") ? m_Client = ModEntry : m_Engine = ModEntry; - return true; - } - while (Module32Next(hModule, &ModEntry)); - - CloseHandle(hModule); - return false; - } - - template - T Read(DWORD dwAddress) - { - T TempValue; - ReadProcessMemory(m_hProcess, (LPVOID)dwAddress, &TempValue, sizeof(T), NULL); - return TempValue; - } - template - T ReadSize(DWORD dwAddress, const size_t& dwSize) - { - T TempValue; - ReadProcessMemory(m_hProcess, (LPVOID)dwAddress, &TempValue, dwSize, NULL); - return TempValue; - } - template - bool ReadArray(DWORD dwAddress, T* Array, const size_t& dwArraySize) - { - if (ReadProcessMemory(m_hProcess, (LPVOID)dwAddress, Array, sizeof(T) * dwArraySize, NULL) == FALSE) - { - Array = nullptr; - return false; - } - return true; - } - std::string ReadString(DWORD dwAddress) - { - char* ch; - ReadProcessMemory(m_hProcess, (LPVOID)dwAddress, ch, 255, NULL); - std::string string = std::string(ch); - - std::string::size_type ind = string.find('\0'); - if (ind != std::string::npos) - string = string.substr(0, ind); - return string; - } - - template - bool Write(DWORD dwAddress, T ValueToWrite) - { - return WriteProcessMemory(m_hProcess, (LPVOID)dwAddress, &ValueToWrite, sizeof(T), NULL) == TRUE; - } - template - bool WriteSize(DWORD dwAddress, T ValueToWrite, const size_t& dwSize) - { - return WriteProcessMemory(m_hProcess, (LPVOID)dwAddress, &ValueToWrite, dwSize, NULL) == TRUE; - } - template - bool WriteArray(DWORD dwAddress, const T* ArrayToWrite, const size_t& dwArraySize) - { - return WriteProcessMemory(m_hProcess, (LPVOID)dwAddress, ArrayToWrite, sizeof(T) * dwArraySize, NULL) == TRUE; - } - - HANDLE* GetHandle() - { - return (this->m_hProcess && this->m_hProcess != INVALID_HANDLE_VALUE) ? &this->m_hProcess : NULL; - } - DWORD GetProcessId() - { - return this->m_dwProcessID; - } - MODULEENTRY32 GetClient() - { - return this->m_Client; - } - MODULEENTRY32 GetEngine() - { - return this->m_Engine; - } - DWORD GetClientBase() - { - return (DWORD)this->m_Client.modBaseAddr; - } - DWORD GetEngineBase() - { - return (DWORD)this->m_Engine.modBaseAddr; - } - DWORD GetClientSize() - { - return this->m_Client.modBaseSize; - } - DWORD GetEngineSize() - { - return this->m_Engine.modBaseSize; - } - - void Close() - { - CloseHandle(this->m_hProcess); - } - -}; - -extern std::unique_ptr CSMemory; \ No newline at end of file From e8146fe4992bb19f470844181a170b025c7ceb28 Mon Sep 17 00:00:00 2001 From: krystalgamer Date: Tue, 12 Jul 2016 11:51:52 +0100 Subject: [PATCH 7/8] Delete NEW EZSKINZ.vcxproj --- NEW EZSKINZ.vcxproj | 90 --------------------------------------------- 1 file changed, 90 deletions(-) delete mode 100644 NEW EZSKINZ.vcxproj diff --git a/NEW EZSKINZ.vcxproj b/NEW EZSKINZ.vcxproj deleted file mode 100644 index c35da64..0000000 --- a/NEW EZSKINZ.vcxproj +++ /dev/null @@ -1,90 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {69DA2F6B-01AA-441A-B823-83C585ABEDC9} - Win32Proj - NEWEZSKINZ - - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - MultiByte - - - - - - - - - - - - - true - - - false - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - - - Console - true - true - true - - - - - - - - - - - - - - - \ No newline at end of file From 0cfd84725af3c8c05a7b580f592f97e1fb07cb2e Mon Sep 17 00:00:00 2001 From: krystalgamer Date: Tue, 12 Jul 2016 11:51:58 +0100 Subject: [PATCH 8/8] Delete NEW EZSKINZ.vcxproj.filters --- NEW EZSKINZ.vcxproj.filters | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 NEW EZSKINZ.vcxproj.filters diff --git a/NEW EZSKINZ.vcxproj.filters b/NEW EZSKINZ.vcxproj.filters deleted file mode 100644 index 58e16cd..0000000 --- a/NEW EZSKINZ.vcxproj.filters +++ /dev/null @@ -1,32 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file