C++ Team Fortress 2 BunnyHop Yapımı

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Ultra Üye
Katılım
27 Kas 2017
Mesajlar
1,566
Çözümler
24
Tepki puanı
95
Ödüller
11
Sosyal
8 HİZMET YILI
1- C++ Boş bir proje oluşturun ve main.cpp memory.h isminde iki adet dosya oluşturun
2- Size verdiğim kodu yapıştırın

Derleyip kullanabilirsiniz iyi eğlenceler.

memory.h

C++:
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <TlHelp32.h>

#include <cstdint>
#include <string_view>

class Memory
{
private:
    std::uintptr_t processId = 0;
    void* processHandle = nullptr;

public:
    // Constructor that finds the process id
    // and opens a handle
    Memory(const std::string_view processName) noexcept
    {
        ::PROCESSENTRY32 entry = { };
        entry.dwSize = sizeof(::PROCESSENTRY32);

        const auto snapShot = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);

        while (::Process32Next(snapShot, &entry))
        {
            if (!processName.compare(entry.szExeFile))
            {
                processId = entry.th32ProcessID;
                processHandle = ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, processId);
                break;
            }
        }

        // Free handle
        if (snapShot)
            ::CloseHandle(snapShot);
    }

    // Destructor that frees the opened handle
    ~Memory()
    {
        if (processHandle)
            ::CloseHandle(processHandle);
    }

    // Returns the base address of a module by name
    const std::uintptr_t GetModuleAddress(const std::string_view moduleName) const noexcept
    {
        ::MODULEENTRY32 entry = { };
        entry.dwSize = sizeof(::MODULEENTRY32);

        const auto snapShot = ::CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, processId);

        std::uintptr_t result = 0;

        while (::Module32Next(snapShot, &entry))
        {
            if (!moduleName.compare(entry.szModule))
            {
                result = reinterpret_cast<std::uintptr_t>(entry.modBaseAddr);
                break;
            }
        }

        if (snapShot)
            ::CloseHandle(snapShot);

        return result;
    }

    // Read process memory
    template <typename T>
    constexpr const T Read(const std::uintptr_t& address) const noexcept
    {
        T value = { };
        ::ReadProcessMemory(processHandle, reinterpret_cast<const void*>(address), &value, sizeof(T), NULL);
        return value;
    }

    // Write process memory
    template <typename T>
    constexpr void Write(const std::uintptr_t& address, const T& value) const noexcept
    {
        ::WriteProcessMemory(processHandle, reinterpret_cast<void*>(address), &value, sizeof(T), NULL);
    }
};

Main.cpp
C++:
#include "memory.h"

#include <thread>
#include <iostream>

namespace offsets
{
    constexpr auto localPlayer = 0xC3F6C0;
    constexpr auto flags = 0x37C;
    constexpr auto forceJump = 0xC6E460;
    constexpr auto entityList = 0xC4D1EC;
    constexpr auto teamNum = 0xB0;
}

__declspec(align(16)) struct Color
{
    constexpr Color(const float r, const float g, const float b, const float a = 1.f) noexcept :
        r(r), g(g), b(b), a(a) { }

    float r, g, b, a;
};

int main()
{
    const auto mem = Memory("hl2.exe");

    std::cout << "Team Fortess 2 found!" << std::endl;

    const auto client = mem.GetModuleAddress("client.dll");
    std::cout << "client.dll -> " << "0x" << std::hex << client << std::dec << std::endl;

    constexpr const auto color = Color{ 1.f, 0.f, 1.f };

    while (true)
    {
        // we don't need this running a billion times per second :)
        std::this_thread::sleep_for(std::chrono::milliseconds(1));

        const auto localPlayer = mem.Read<std::uintptr_t>(client + offsets::localPlayer);

        if (!localPlayer)
            continue;

        const auto localPlayerTeam = mem.Read<std::uintptr_t>(localPlayer + offsets::teamNum);
        const auto localPlayerFlags = mem.Read<std::uintptr_t>(localPlayer + offsets::flags);

        // bhop
        if (GetAsyncKeyState(VK_SPACE))
            (localPlayerFlags & (1 << 0)) ?
            mem.Write<std::uintptr_t>(client + offsets::forceJump, 6) :
            mem.Write<std::uintptr_t>(client + offsets::forceJump, 4);
    }
}
 
☆☆Her oyun bir gün hileyi tadacaktır☆☆
Griffin Premium
Katılım
12 Kas 2017
Mesajlar
13,726
Çözümler
240
Tepki puanı
5,133
Ödüller
23
8 HİZMET YILI
Güzel bir konu olmuş dostum ellerine sağlık 👍
 
Süper Üye
Katılım
1 Şub 2019
Mesajlar
801
Çözümler
6
Tepki puanı
142
Ödüller
9
Sosyal
7 HİZMET YILI
Gayet başarılı bir konu olmuş. Akarı yok kokarı yok. Kopyala yapıştır derle. Eline sağlık.
 
Onaylı Üye
Katılım
15 Ocak 2023
Mesajlar
53
Tepki puanı
5
Ödüller
2
Yaş
24
3 HİZMET YILI
1- C++ Boş bir proje oluşturun ve main.cpp memory.h isminde iki adet dosya oluşturun
2- Size verdiğim kodu yapıştırın

Derleyip kullanabilirsiniz iyi eğlenceler.

memory.h

C++:
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <TlHelp32.h>

#include <cstdint>
#include <string_view>

class Memory
{
private:
    std::uintptr_t processId = 0;
    void* processHandle = nullptr;

public:
    // Constructor that finds the process id
    // and opens a handle
    Memory(const std::string_view processName) noexcept
    {
        ::PROCESSENTRY32 entry = { };
        entry.dwSize = sizeof(::PROCESSENTRY32);

        const auto snapShot = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);

        while (::Process32Next(snapShot, &entry))
        {
            if (!processName.compare(entry.szExeFile))
            {
                processId = entry.th32ProcessID;
                processHandle = ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, processId);
                break;
            }
        }

        // Free handle
        if (snapShot)
            ::CloseHandle(snapShot);
    }

    // Destructor that frees the opened handle
    ~Memory()
    {
        if (processHandle)
            ::CloseHandle(processHandle);
    }

    // Returns the base address of a module by name
    const std::uintptr_t GetModuleAddress(const std::string_view moduleName) const noexcept
    {
        ::MODULEENTRY32 entry = { };
        entry.dwSize = sizeof(::MODULEENTRY32);

        const auto snapShot = ::CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, processId);

        std::uintptr_t result = 0;

        while (::Module32Next(snapShot, &entry))
        {
            if (!moduleName.compare(entry.szModule))
            {
                result = reinterpret_cast<std::uintptr_t>(entry.modBaseAddr);
                break;
            }
        }

        if (snapShot)
            ::CloseHandle(snapShot);

        return result;
    }

    // Read process memory
    template <typename T>
    constexpr const T Read(const std::uintptr_t& address) const noexcept
    {
        T value = { };
        ::ReadProcessMemory(processHandle, reinterpret_cast<const void*>(address), &value, sizeof(T), NULL);
        return value;
    }

    // Write process memory
    template <typename T>
    constexpr void Write(const std::uintptr_t& address, const T& value) const noexcept
    {
        ::WriteProcessMemory(processHandle, reinterpret_cast<void*>(address), &value, sizeof(T), NULL);
    }
};

Main.cpp
C++:
#include "memory.h"

#include <thread>
#include <iostream>

namespace offsets
{
    constexpr auto localPlayer = 0xC3F6C0;
    constexpr auto flags = 0x37C;
    constexpr auto forceJump = 0xC6E460;
    constexpr auto entityList = 0xC4D1EC;
    constexpr auto teamNum = 0xB0;
}

__declspec(align(16)) struct Color
{
    constexpr Color(const float r, const float g, const float b, const float a = 1.f) noexcept :
        r(r), g(g), b(b), a(a) { }

    float r, g, b, a;
};

int main()
{
    const auto mem = Memory("hl2.exe");

    std::cout << "Team Fortess 2 found!" << std::endl;

    const auto client = mem.GetModuleAddress("client.dll");
    std::cout << "client.dll -> " << "0x" << std::hex << client << std::dec << std::endl;

    constexpr const auto color = Color{ 1.f, 0.f, 1.f };

    while (true)
    {
        // we don't need this running a billion times per second :)
        std::this_thread::sleep_for(std::chrono::milliseconds(1));

        const auto localPlayer = mem.Read<std::uintptr_t>(client + offsets::localPlayer);

        if (!localPlayer)
            continue;

        const auto localPlayerTeam = mem.Read<std::uintptr_t>(localPlayer + offsets::teamNum);
        const auto localPlayerFlags = mem.Read<std::uintptr_t>(localPlayer + offsets::flags);

        // bhop
        if (GetAsyncKeyState(VK_SPACE))
            (localPlayerFlags & (1 << 0)) ?
            mem.Write<std::uintptr_t>(client + offsets::forceJump, 6) :
            mem.Write<std::uintptr_t>(client + offsets::forceJump, 4);
    }
}
Eline koluna sağlık güzel iş :)
 
HER OYUNUN BİR AÇIĞI VARDIR
Ultra Üye
Katılım
1 Ara 2017
Mesajlar
1,510
Çözümler
1
Tepki puanı
118
Ödüller
9
Yaş
25
8 HİZMET YILI
Dostum çok iyi olmuş Daha güzellerinide bekliyoruz eline sağlıkk.
 
Seçkin Üye
Katılım
14 Ara 2019
Mesajlar
325
Çözümler
1
Tepki puanı
18
Ödüller
5
Yaş
28
6 HİZMET YILI
Visual studio code ile derleyebilir miyiz?
 
Sultan Yousafzai
Onaylı Üye
Katılım
19 Nis 2022
Mesajlar
69
Tepki puanı
5
Ödüller
3
Sosyal
4 HİZMET YILI
My fauorite language is C++ pyhton and java
 
Uzman Üye
Katılım
19 Ocak 2023
Mesajlar
159
Tepki puanı
18
Ödüller
2
3 HİZMET YILI
baya iyi hocam aştınız artık kendinizi
 
Üye
Katılım
5 Mar 2022
Mesajlar
10
Tepki puanı
0
Ödüller
1
Yaş
27
4 HİZMET YILI
teşekkürler brom. genelde fare makrolarıyla yapıyorlar bunlar yakalanırsa 3. parti yazılım olarak ban yeme ihtimalini de arttırır diye düşünüyorıum
 
Onaylı Üye
Katılım
4 Tem 2020
Mesajlar
51
Tepki puanı
5
Ödüller
3
Yaş
25
5 HİZMET YILI
1- C++ Boş bir proje oluşturun ve main.cpp memory.h isminde iki adet dosya oluşturun
2- Size verdiğim kodu yapıştırın

Derleyip kullanabilirsiniz iyi eğlenceler.

memory.h

C++:
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <TlHelp32.h>

#include <cstdint>
#include <string_view>

class Memory
{
private:
    std::uintptr_t processId = 0;
    void* processHandle = nullptr;

public:
    // Constructor that finds the process id
    // and opens a handle
    Memory(const std::string_view processName) noexcept
    {
        ::PROCESSENTRY32 entry = { };
        entry.dwSize = sizeof(::PROCESSENTRY32);

        const auto snapShot = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);

        while (::Process32Next(snapShot, &entry))
        {
            if (!processName.compare(entry.szExeFile))
            {
                processId = entry.th32ProcessID;
                processHandle = ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, processId);
                break;
            }
        }

        // Free handle
        if (snapShot)
            ::CloseHandle(snapShot);
    }

    // Destructor that frees the opened handle
    ~Memory()
    {
        if (processHandle)
            ::CloseHandle(processHandle);
    }

    // Returns the base address of a module by name
    const std::uintptr_t GetModuleAddress(const std::string_view moduleName) const noexcept
    {
        ::MODULEENTRY32 entry = { };
        entry.dwSize = sizeof(::MODULEENTRY32);

        const auto snapShot = ::CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, processId);

        std::uintptr_t result = 0;

        while (::Module32Next(snapShot, &entry))
        {
            if (!moduleName.compare(entry.szModule))
            {
                result = reinterpret_cast<std::uintptr_t>(entry.modBaseAddr);
                break;
            }
        }

        if (snapShot)
            ::CloseHandle(snapShot);

        return result;
    }

    // Read process memory
    template <typename T>
    constexpr const T Read(const std::uintptr_t& address) const noexcept
    {
        T value = { };
        ::ReadProcessMemory(processHandle, reinterpret_cast<const void*>(address), &value, sizeof(T), NULL);
        return value;
    }

    // Write process memory
    template <typename T>
    constexpr void Write(const std::uintptr_t& address, const T& value) const noexcept
    {
        ::WriteProcessMemory(processHandle, reinterpret_cast<void*>(address), &value, sizeof(T), NULL);
    }
};

Main.cpp
C++:
#include "memory.h"

#include <thread>
#include <iostream>

namespace offsets
{
    constexpr auto localPlayer = 0xC3F6C0;
    constexpr auto flags = 0x37C;
    constexpr auto forceJump = 0xC6E460;
    constexpr auto entityList = 0xC4D1EC;
    constexpr auto teamNum = 0xB0;
}

__declspec(align(16)) struct Color
{
    constexpr Color(const float r, const float g, const float b, const float a = 1.f) noexcept :
        r(r), g(g), b(b), a(a) { }

    float r, g, b, a;
};

int main()
{
    const auto mem = Memory("hl2.exe");

    std::cout << "Team Fortess 2 found!" << std::endl;

    const auto client = mem.GetModuleAddress("client.dll");
    std::cout << "client.dll -> " << "0x" << std::hex << client << std::dec << std::endl;

    constexpr const auto color = Color{ 1.f, 0.f, 1.f };

    while (true)
    {
        // we don't need this running a billion times per second :)
        std::this_thread::sleep_for(std::chrono::milliseconds(1));

        const auto localPlayer = mem.Read<std::uintptr_t>(client + offsets::localPlayer);

        if (!localPlayer)
            continue;

        const auto localPlayerTeam = mem.Read<std::uintptr_t>(localPlayer + offsets::teamNum);
        const auto localPlayerFlags = mem.Read<std::uintptr_t>(localPlayer + offsets::flags);

        // bhop
        if (GetAsyncKeyState(VK_SPACE))
            (localPlayerFlags & (1 << 0)) ?
            mem.Write<std::uintptr_t>(client + offsets::forceJump, 6) :
            mem.Write<std::uintptr_t>(client + offsets::forceJump, 4);
    }
}
Hocam ben tam olarak bilmiyorum kullanmayı oyuna girip napıcam bunu yaptıktan sonra
 
Ultra Üye
Katılım
31 Ocak 2023
Mesajlar
1,558
Çözümler
3
Tepki puanı
49
Ödüller
4
Yaş
24
3 HİZMET YILI
bu tarz konular gelmesi çok iyi yavaştan c++ başlamak için harika.
 
Onaylı Üye
Katılım
8 Haz 2016
Mesajlar
52
Tepki puanı
7
Ödüller
7
10 HİZMET YILI
Gelişime açık bir kaynak eline sağlık paylaşım için teşekkürler ama merak ettiğim konu bunny hop denilen olay oyunun içindeki zıplama kuvvetinin değişimi ile nasıl sağlanıyor olabilir mantıken aklıma gelen cevap zıplama animasyonu bitmeden yeniden girmesi bu sayede döngüye giriyor
 
Onaylı Üye
Katılım
4 Ara 2020
Mesajlar
52
Tepki puanı
1
Ödüller
5
Yaş
28
5 HİZMET YILI
biraz karısık görünüyor ama göz asinalıgı olunca yapılmayacak ögrenilmeyecek degil
 
Seçkin Üye
Katılım
23 Şub 2020
Mesajlar
303
Tepki puanı
7
Ödüller
6
Yaş
27
6 HİZMET YILI
dostum tam olarak nasıl aktifleştiriyoruz
 
Uzman Üye
Katılım
14 Eki 2016
Mesajlar
259
Tepki puanı
14
Ödüller
9
9 HİZMET YILI
eline emeğine sağlık güzel bir konu ybilgi yararıma oldu teşekkürler
 
Banlı Üye
Katılım
20 Ağu 2023
Mesajlar
44
Tepki puanı
2
Yaş
25
2 HİZMET YILI
ben bilmiyorumda nası calıstırıcağımı ögrete bilirmisin
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Üst