having toruble with creating a dll... the guy posted the source which is below for his dll that goes with his loader:
esroLoaderdll.cpp:
i put this in c++ and when i tried to compile it i got the foloowing error:
Im a nooby to all this i just copy and pasted the code in c++, and starterd a new win 32 console appliaction and selcted dll, than pasted this. press build and results above :P
can anyone tell me where im going wrong?
heres a link to the origonal thread, my purpose is to simply change the line:
[Only registered and activated users can see links. Click Here To Register...]
too
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;
}
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 ==========
can anyone tell me where im going wrong?
heres a link to the origonal thread, my purpose is to simply change the line:
[Only registered and activated users can see links. Click Here To Register...]
Code:
float range = 5000;
Code:
float range = 2000;