Example #1
0
// 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<CPatternScanner>(new CPatternScanner(CSMemory->GetHandle(), CSMemory->GetClient()));
	EngineScanner = std::unique_ptr<CPatternScanner>(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<DWORD>(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<DWORD>(LocalPlayer + m_hMyWeapons + ((i - 1) * 0x4)) & 0xFFF;
			DWORD CurrentWeaponEntity = CSMemory->Read<DWORD>(CSMemory->GetClientBase() + m_dwEntityList + (CurrentWeaponIndex - 1) * 0x10);
			int CurrentWeaponId = CSMemory->Read<int>(CurrentWeaponEntity + m_iItemDefinitionIndex);
			int MyXuid = CSMemory->Read<int>(CurrentWeaponEntity + m_OriginalOwnerXuidLow);
			CSMemory->Write<int>(CurrentWeaponEntity + m_iItemIDLow, 2048); // Hehe
			CSMemory->Write<int>(CurrentWeaponEntity + m_iItemIDHigh, 0);
			if (IniParser->SectionExists(std::to_string(CurrentWeaponId).c_str()))
			{
				CSMemory->Write<int>(CurrentWeaponEntity + m_nFallbackPaintKit, IniParser->ReadInt(std::to_string(CurrentWeaponId).c_str(), "PaintKit"));
				CSMemory->Write<int>(CurrentWeaponEntity + m_nFallbackSeed, IniParser->ReadInt(std::to_string(CurrentWeaponId).c_str(), "Seed"));
				CSMemory->Write<int>(CurrentWeaponEntity + m_nFallbackStatTrak, IniParser->ReadInt(std::to_string(CurrentWeaponId).c_str(), "StatTrak"));
				CSMemory->Write<int>(CurrentWeaponEntity + m_iEntityQuality, IniParser->ReadInt(std::to_string(CurrentWeaponId).c_str(), "EntityQuality"));
				CSMemory->WriteArray<char>(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<float>(CurrentWeaponEntity + m_flFallbackWear, IniParser->ReadFloat(std::to_string(CurrentWeaponId).c_str(), "Wear"));
			}
			CSMemory->Write<int>(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;
}