本文整理汇总了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);
}
//.........这里部分代码省略.........