having toruble with the dll...
esroLoaderdll.cpp:
Code:
#include "windows.h"
void WriteMemory(DWORD address, LPVOID patch, DWORD size)
{
DWORD oldProtect;
VirtualProtect((LPVOID)address, 4, PAGE_EXECUTE_READWRITE, &oldProtect);
memcpy((LPVOID)address, patch, size);
}
DWORD WINAPI PatchRangeThread(LPVOID lpParam) //need to wait for sro window or we get protection error
{
while(1)
{
HWND hWnd = FindWindowA("CLIENT", 0);
DWORD pid = 0;
GetWindowThreadProcessId(hWnd, &pid);
if(pid == GetCurrentProcessId())
break;
Sleep(10);
}
float range = 5000;
WriteMemory(0xD10678, &range, sizeof(float));
return 0;
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
if(ul_reason_for_call == DLL_PROCESS_ATTACH)
{
CreateMutexA(0, 0, "Silkroad Online Launcher");
CreateMutexA(0, 0, "Ready");
CreateThread(0, 0, &PatchRangeThread, 0, 0, 0);
}
return true;
}
i put this in c++ and when i tried to compile it i got the foloowing error:
Code:
1>------ Build started: Project: test, Configuration: Release Win32 ------
1> test.cpp
1>test.cpp(40): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Im a nooby to all this i just copy and pasted the code, and starterd a new win 32 console appliaction and selcted dll, than pasted this. press build and results above :P