Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online
You last visited: Today at 06:21

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Request]C++ Bot Source Code/Example Code

Discussion on [Request]C++ Bot Source Code/Example Code within the Silkroad Online forum part of the Popular Games category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2007
Posts: 649
Received Thanks: 105
[Request]C++ Bot Source Code/Example Code

Please someone direct me to anywhere that might have any sort of information and resources on the construction of a bot, preferably in C++. Looking for any Reverse engineering information(finding the Base addr for say player) and locating the offsets ptrs for Cur health etc. I would also love to see a simple example source in C++ of putting those addresses and offsets into action. I'm sure I have the basic idea down on how to do this but I'm not 100% sure how to get it setup correctly.

If someone that has a good understanding off C++ could just post a simple example of something along the lines of: Reading from a the addr + offset of say the current health or something else useful, into a pointer and using that pointer to simply log the current health into a log txt file that example would help me out a lot to get started.

My basic idea of what to do here is this:
Setup an empty variable that will hold the currenthealth value later. Using ReadProcessMemory and reading from the PlayerPtrAddr + CurHealthOffset(450?) and store that into currenthealth variable. Then just setup a log that will log what the value of the currenthealth variable is. I have a basic idea of what this would like but I have limited knowledge of C++ and coding and it has been a while Since I have done anything like this. I used to use this type of setup in a lot of FPS games I played but I have since lost all sources and documents that I had regarding this and can't seem to fully remember how to set it all up correctly.

Just need a detailed example of how to setup the empty currenthealth variable and then reading the value from the baseaddr + offset into that variable and then executing the log of that into a .txt log file.

Thanks for any information you can give me.
Iktov is offline  
Old 07/19/2008, 04:22   #2
 
elite*gold: 0
Join Date: Apr 2007
Posts: 649
Received Thanks: 105
/add

Ok well here is what I put together so far, Hopefully someone with some C++ knowledge can help to perfect it/and or confirm weather it would work correctly or not:

CODE:

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windows.h>
#include <iostream>
#include <time.h>

HANDLE iSRO = GetCurrentProcess();

#define FILELOCATION "C:\\SRO_log.txt"

void __cdecl add_log(const char * fmt, ...)
{
#ifndef _NO_ADD
va_list va_alist;
char logbuf[256];
FILE * fp;
struct tm * current_tm;
time_t current_time;

time (&current_time);
current_tm = localtime (&current_time);

sprintf (logbuf, "[%02d:%02d:%02d] ", current_tm->tm_hour, current_tm->tm_min, current_tm->tm_sec);

va_start (va_alist, fmt);
_vsnprintf (logbuf+strlen(logbuf), sizeof(logbuf) - strlen(logbuf), fmt, va_alist);
va_end (va_alist);

if ( (fp = fopen ( FILELOCATION , "a")) != NULL )
{
fprintf ( fp, "%s\n", logbuf );
fclose (fp);
}
#endif _NO_ADD
}
BOOL WINAPI DllMain (HINSTANCE hModule, DWORD dwAttached, LPVOID lpvReserved)
{
if (dwAttached == DLL_PROCESS_ATTACH)
{
add_log("DLL Attatched to SRO Client");
DWORD dwBytesread;
DWORD dwCurHealth;
DWORD dwPlayerBase;

ReadProcessMemory(iSRO, (void*)(0xCEBB4C), &dwPlayerBase, sizeof(dwPlayerBase), &dwBytesread);
ReadProcessMemory(iSRO, (void*)(dwPlayerBase+0x450), &dwCurHealth, sizeof(dwCurHealth), &dwBytesread);
add_log("CurrentHealth = 0x%.8x", (DWORD)dwCurHealth);
}

return 1;
}


Assuming everything is done correctly the variable dwCurHealth should hold the value of the current health of my character? At least that is what I am going for anyways. At this point however I am unsure how to test it as I don't know how to set it up the log the Value of my Variable dwCurHealth. Can anybody help me here and also confirm my addresses by chance. Thanks
Iktov is offline  
Old 07/19/2008, 15:07   #3
 
elite*gold: 0
Join Date: Mar 2007
Posts: 849
Received Thanks: 668
btw have u ever thought of using search?

look for and bot sourcecode... or if invincible is still here ask him he was part of team offset ( or still is ) and they had a post with and bot source code, whcih was also posted here.....
royalblade is offline  
Reply


Similar Threads Similar Threads
B> DriftCity CBS Code | S> War Rock Code / Bounty Bay Code etc.
10/05/2010 - Trading - 1 Replies
Hi, wie schon im Titel beschrieben. In der CBS vom November gab es Bonusodes für mehrere Spiele. Ich benötige DriftCity Codes. Kann sonst für alle anderen Spiele die Codes biten, einige auch doppelt. Hier eine Liste der Spiele und Bonusaktionen: - (2x) War Rock - (2x) War of Titans - (2x) World of Warcraft - (1x) Warhammer Online - (1x) Bounty Bay online
Request Trainer source code
07/20/2010 - 12Sky2 - 0 Replies
yep hope i can find simple one who is not complicated who need only to replace codes, and simple explaining the way to make the trainer complete
[Request]Pharmacist Items Code So I Code Buy the Scroll
05/30/2009 - CO2 Private Server - 1 Replies
could you please teach me how to code Pharmacist Items so i could buy them all especially the scrolls.
[Request] for 2nd reborn source code
04/20/2009 - CO2 Private Server - 4 Replies
Request for 2nd reborn: 1. level 120 (water tao 110) message me 2. 2 super gem w/ any weapon +12 3. any profiency fixed, EX: sword prof level 20



All times are GMT +1. The time now is 06:21.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.