Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // mod.cpp : Defines the exported functions for the DLL application.
- //
- #include "stdafx.h"
- std::string testString = "SexyDog";
- DWORD pid = 0;
- HANDLE H;
- #pragma warning(disable:4996)
- void init()
- {
- WriteByteInt((LPVOID)0x00663A8D, 1920);
- WriteByteInt((LPVOID)0x00663A95, 1080);
- WriteByteInt((LPVOID)0x0019F9FC, 1920);
- WriteByteInt((LPVOID)0x0019FA00, 1080);
- //std::string newValue = "hugo";
- char* str = (char*)0x00716A0C;
- HANDLE curHandle = OpenProcess(PROCESS_ALL_ACCESS, TRUE, pid);
- void* addr = update;
- std::vector<unsigned char> addrVec = intToBytes(((int)(addr)-(5)) - 0x006BDAD8);
- BYTE bytes[] = { 0xE8,addrVec[3],addrVec[2],addrVec[1],addrVec[0],0x90,0x90,0xC3 };
- DWORD tID = GetMainThreadId();
- HANDLE hToken;
- int yoWTF = GetLastError();
- int yoWTFx2 = GetLastError();
- DWORD old;
- VirtualProtect((LPVOID)(0x006BDAD8), sizeof(bytes), PAGE_EXECUTE_READWRITE, &old);
- SIZE_T bytesWritten = 0;
- WriteProcessMemory(curHandle, (LPVOID)(0x006BDAD8), bytes, sizeof(bytes), &bytesWritten);
- int error = GetLastError();
- //VirtualProtect((LPVOID)(0x006BDAD8), sizeof(bytes), old, NULL);
- std::ofstream myfile;
- myfile.open("output.txt");
- myfile << GetCurrentThreadId() << " : " << error << " " << " : " << curHandle << " : " << bytesWritten << " " << " " << yoWTFx2 << " : " << " : " << pid;
- myfile.close();
- //unsigned char* c = (unsigned char*)(0x006BDAD8);
- char* c = (char*)&error;
- VirtualProtect(update, 3000, PAGE_EXECUTE_READWRITE, NULL);
- VirtualProtect(str, 4, PAGE_EXECUTE_READWRITE, &old);
- char buffer[] = "M o d L o a d ";
- for (int i = 1; i < 15; i += 2)
- buffer[i] = 0;
- memcpy(str, buffer, 16);
- VirtualProtect(str, 4, old, NULL);
- }
- void WriteByteInt(LPVOID pointer, int i)
- {
- DWORD old;
- int* loc = &i;
- VirtualProtect(pointer, 4, PAGE_EXECUTE_READWRITE, &old);
- memcpy(pointer, loc, 4);
- VirtualProtect((LPVOID)0x77810F34, 4, old, NULL);
- }
- typedef void*(*GetCurPlayer)(void*, void*);
- GetCurPlayer getCurPlayer = (GetCurPlayer)0x00621040;
- typedef void(*VOIDFUNCTION)(void);
- VOIDFUNCTION func = (VOIDFUNCTION)0x0059110A;
- bool allocedConsole = false;
- typedef std::vector<void*> CleanVector;
- typedef int(*INTFUNCTION)(void);
- typedef DWORD(*FUNCTIONCALL)();
- FUNCTIONCALL fCall = (FUNCTIONCALL)0x00571D40;
- INTFUNCTION getSomething = (INTFUNCTION)0x006B6240;
- extern "C" void __cdecl update()
- {
- std::cout << "HELP" << std::endl;
- if (GetAsyncKeyState(0x45))
- {
- void* p = getCurPlayer((void*)0x03BE1D01,(void*)0x03CA0348);
- // int* p = (int*)getSomething();
- std::ofstream myfile;
- myfile.open("playerlocationpls.txt");
- //myfile << p;
- myfile.close();
- }
- if (GetAsyncKeyState(0x43))
- {
- CleanVector* cv = (CleanVector*)0x0077DEC4;
- std::ofstream myfile;
- myfile.open("objectDump.txt");
- myfile << cv->size();
- myfile.close();
- }
- }
- void SetStartPointer(int* pointer)
- {
- DWORD old;
- VirtualProtect((void*)0x00714EE0, 4, PAGE_EXECUTE_READWRITE, &old);
- memcpy(pointer, pointer, 4);
- }
- std::vector<unsigned char> intToBytes(int paramInt)
- {
- std::vector<unsigned char> arrayOfByte(4);
- for (int i = 0; i < 4; i++)
- arrayOfByte[3 - i] = (paramInt >> (i * 8));
- return arrayOfByte;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement