Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <vector>
- #include <Psapi.h>
- #define gay true
- #define anal BOOL
- #define sex DllMain
- #define pout Sleep
- #define INRANGE(x,a,b) (x >= a && x <= b)
- #define GET_BYTE( x ) (GET_BITS(x[0]) << 4 | GET_BITS(x[1]))
- #define GET_BITS( x ) (INRANGE((x&(~0x20)),'A','F') ? ((x&(~0x20)) - 'A' + 0xa) : (INRANGE(x,'0','9') ? x - '0' : 0))
- uintptr_t find_sig(const char* module, const char* sig);
- void ur_gay()
- {
- static auto set_gayness = reinterpret_cast<void(__fastcall*)(const char*, const char*)>(find_sig("engine.dll", "53 56 57 8B DA 8B F9 FF 15"));
- while (gay)
- {
- set_gayness("EACHAK", "EACHAK");
- pout(5000);
- }
- }
- anal sex(HMODULE module, DWORD reason, LPVOID reserverd)
- {
- if (reason == DLL_PROCESS_ATTACH)
- CreateThread(nullptr, NULL, (LPTHREAD_START_ROUTINE)ur_gay, nullptr, NULL, nullptr);
- }
- uintptr_t find_sig(const char* module, const char* sig)
- {
- auto pat = sig;
- std::vector<short> bytes;
- bool reached_end = false;
- while (*pat)
- {
- bool short_byte = false;
- if (pat[0] == '\?')
- {
- if (pat[1] != '\?')
- short_byte = true;
- bytes.push_back(-1);
- }
- else
- bytes.push_back(GET_BYTE(pat));
- if (reached_end)
- break;
- if (short_byte)
- pat += 2;
- else
- pat += 3;
- if (!pat[2])
- reached_end = true;
- }
- auto base = (uintptr_t)GetModuleHandleA(module);
- MODULEINFO info;
- GetModuleInformation(GetCurrentProcess(), (HMODULE)base, &info, sizeof(MODULEINFO));
- auto end = base + info.SizeOfImage;
- uintptr_t addr;
- auto len = bytes.size();
- for (auto i = base; i < end - len; i++)
- {
- bool found = true;
- for (auto y = 0; y < len && found; y++)
- if (bytes[y] >= 0 && *(BYTE*)(i + y) != bytes[y]) // if not wildcard and not matching byte, set to false to stop iterating
- found = false;
- if (found) // if iterated through all bytes and it matched, return address
- {
- addr = i;
- break;
- }
- }
- return addr;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement