Not a member yet? Register for your free account!


Go Back   elitepvpers > Silkroad Online > SRO Coding Corner
You last visited: Today at 07:16

  • Did you know? elitepvpers has its own image host, epvpimg.com.

 

Range modify ESRO code chaning?

This is a discussion on Range modify ESRO code chaning? within the SRO Coding Corner forum part of the Silkroad Online category; having toruble with creating a dll... the guy posted the source which is below for his dll that goes with ...

Reply
 
Thread Tools
Old 06-13-2011, 18:30   #1
Ex - Atomix Owner
 
smedheaddk's Avatar
 
Join Date: Jul 2008
Posts: 516
Received Thanks: 351
Range modify ESRO code chaning?


having toruble with creating a dll... the guy posted the source which is below for his dll that goes with his loader:

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 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:

[ESRO] Loader with range patch

Code:
	float range = 5000;
too

Code:
	float range = 2000;
__________________

smedheaddk is offline  
Old 06-13-2011, 19:08   #2
Lithuanian
 
* White *'s Avatar
 
Join Date: Oct 2010
Posts: 700
Received Thanks: 301
Code:
#include "windows.h"
#include "StdAfx.h"  // Try to add this( i dont know too about this but just try :D )

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;
}
* White * is offline  
Old 06-13-2011, 19:33   #3
Senior Member
 
bootdisk's Avatar
 
Join Date: Sep 2010
Posts: 134
Received Thanks: 38
or just don't use precompiled headers...
they're useful on large scale project but for hacks, emus it looks pointless...
bootdisk is offline  
Old 06-14-2011, 10:09   #4
OMG !!!!!!!!!11einself
 
chea77er's Avatar
 
Join Date: Oct 2009
Posts: 290
Received Thanks: 191
Quote:
Originally Posted by bootdisk View Post
or just don't use precompiled headers...
they're useful on large scale project but for hacks, emus it looks pointless...
emus are large projects.

BTT: You can disable precompiled headers. in Visual-Studio
(Project Properties -> C/C++ -> Precompiled Header -> .. )
chea77er is offline  
Reply

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Req]Guide How To Modify Auto select Range at KSroClient Ahmos2009 SRO Ask the Experts 7 03-15-2012 19:23
[ESRO] Loader with range patch jremy Private SRO Exploits/Hacks/Bots/Guides 259 01-21-2012 01:16
Range modify EXRO code chaning? smedheaddk SRO Coding Corner 0 06-13-2011 18:27
How can i modify this code? Panquque CO2 PServer - Discussions / Questions 2 12-16-2009 18:32
HELP with Ip chaning for registerpage We$ley EO PServer Hosting 2 10-02-2008 16:55




All times are GMT +2. The time now is 07:16.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.