当前位置: 首页>>代码示例>>C++>>正文


C++ unique_ptr::AttachProcess方法代码示例

本文整理汇总了C++中std::unique_ptr::AttachProcess方法的典型用法代码示例。如果您正苦于以下问题:C++ unique_ptr::AttachProcess方法的具体用法?C++ unique_ptr::AttachProcess怎么用?C++ unique_ptr::AttachProcess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在std::unique_ptr的用法示例。


在下文中一共展示了unique_ptr::AttachProcess方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

// 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);
		}

//.........这里部分代码省略.........
开发者ID:legitplayer,项目名称:EzSkinzNEW,代码行数:101,代码来源:main.cpp


注:本文中的std::unique_ptr::AttachProcess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。