Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Hacks, Bots, Cheats & Exploits
You last visited: Today at 23:55

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

Advertisement



[source] find offsets in c++ (in sro_client.exe)

Discussion on [source] find offsets in c++ (in sro_client.exe) within the SRO Hacks, Bots, Cheats & Exploits forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2007
Posts: 242
Received Thanks: 49
[source] find offsets in c++ (in sro_client.exe)

C++ does not offer something like AutoIt does, so I had to do it myself. The main idea of the code (how to do it) was a suggestion of Drew Benton. The search patters are from lolkop's AutoIt script.

This is how it looks in AutoIt:
Code:
$pos = StringRegExp($content, "81C4EC010000C21400(.*?)CCCCCCCCCCCCCCCC", 3)
Here is my C++ script, still messy code and can't be added like this to anything really... I might make it write all offsets in some config file or something when I'll have time to rewrite it.
Code:
// SilkSearch.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "windows.h"
#include "stdio.h"
#include "stdlib.h"

int _tmain(int argc, _TCHAR* argv[])
{
	FILE * pFile;
	long lSize;
	BYTE * buffer;
	size_t result;

	
	//pFile = fopen ( "C:\\Documents and Settings\\Safilix\\Desktop\\USB - SQL\\au3\\New Folder\\sro_client.exe" , "rb" );
	fopen_s(&pFile, "C:\\Documents and Settings\\Safilix\\Desktop\\USB - SQL\\au3\\New Folder\\sro_client.exe" , "rb" );
	if (pFile==NULL) {
		fputs ("File error",stderr);
		exit (1);
	}

	fseek (pFile , 0 , SEEK_END);
	lSize = ftell (pFile);
	rewind (pFile);

	buffer = (BYTE*) malloc (sizeof(char)*lSize);
	if (buffer == NULL) {
		fputs ("Memory error",stderr);
		exit (2);
	}

	result = fread (buffer,1,lSize,pFile);
	if (result != lSize) {
		fputs ("Reading error",stderr);
		exit (3);
	}

	printf("Loaded the file! Begin the search...\n\n");

	int pointer = 0;
	BYTE * data = buffer;
	BYTE pattern[] = { 0x81, 0xC4, 0xEC, 0x01, 0x00, 0x00, 0xC2, 0x14, 0x00 };
	BYTE pattern2[] = { 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC };
	LPBYTE start = data;
	LPBYTE end = start + lSize;
	LPBYTE cur = start;
	LPBYTE tmp;
	bool found = true;
	
	while(cur < end)
	{
		while(*++cur != *pattern && cur < end);
		found = true;
		for(int x = 0; x < sizeof(pattern); x++)
		{
			if(*(cur + x) != pattern[x])
			{
				found = false;
				break;
			}
		}
		if(found)
		{
			while(cur < end)
			{
				tmp = cur;
				while(*++tmp != *pattern2 && tmp < end);
				found = true;
				for(int x = 0; x < sizeof(pattern2); x++)
				{
					if(*(tmp + x) != pattern2[x])
					{
						found = false;
						break;
					}
				}
				if(found) break;

			}

			for(int x = 0; x < (int)(tmp - cur - sizeof(pattern2)); x++)
			{
				if(!(x%4))
				{
					printf("\n");
				}
				if(x == 36)
					printf("\nwhisper: ");
				if(x == 12)
					printf("\nparty: ");
				if(x == 16)
					printf("\nguild: ");
				if(x == 40)
					printf("\nunion: ");
				if(x == 20)
					printf("\nglobal: ");

				if(!(x%4))
				{
					pointer = 0;
					for(int y = 3; y>=0; y--)
					{
						pointer <<= 8;
						pointer += *(cur + sizeof(pattern) + y + x);
					}
					printf("[%x] - ", pointer);
				}
				printf("%2x ", *(cur + sizeof(pattern) + x));
			}
			printf("\n");
		}
	}

	fclose (pFile);
	free (buffer);

	return 0;
}
Feel free to play around with it, it's nothing for beginners. You REALLY have to understand a lot of C++, even I had a few problems to understand the base that Drew gave me. Later I figured it out somehow. ^^
TheSpy is offline  
Thanks
3 Users
Old 02/21/2009, 13:57   #2
 
elite*gold: 0
Join Date: Dec 2007
Posts: 46
Received Thanks: 2
Ty with respect
necro_3 is offline  
Old 02/21/2009, 15:11   #3
 
lolkop's Avatar
 
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
theres no regexp included in c++? :O
lolkop is offline  
Old 02/21/2009, 15:32   #4
 
elite*gold: 0
Join Date: Dec 2007
Posts: 242
Received Thanks: 49
Quote:
Originally Posted by lolkop View Post
theres no regexp included in c++? :O
There is, but you can't load in the file as a normal string (well you can, but it takes ages to do anything) so that's why this has to be done. It does it's work in a matter of milliseconds.

Btw... could a mod rename the thread to "[source] find offsets in c++ (in sro_client.exe)" please? I forgot to add it >_<

#Done
TheSpy is offline  
Reply


Similar Threads Similar Threads
Request how to find handle_address (of sro_client )
12/27/2009 - Silkroad Online - 3 Replies
how find handle_address of sro_client i need it pls say i need it fast
How to find certain offsets
12/02/2009 - Dekaron - 8 Replies
I'm trying to learn how to write my own CE scripts, since I know assembly language decently well, I figured it would be a good, easy thing to learn. However, I read the tut that somebody posted and they used wallhack as the example, which is pretty easy to follow and understand. My question is, how do I find things that are not as easy (searching for .mac). I want to re-create a range hack, since the old script that I have doesn't work anymore. How do I search for the range of all skills?...
new offsets of sro_client [request] (KSRO)
11/29/2009 - Silkroad Online - 5 Replies
pls some one to post them because i don't know how to find them ..
Range Help (can't find offsets?)
07/07/2009 - Dekaron - 5 Replies
I am trying to get range hack put into my CT, but I cannot seem to find the correct offset. I've used both the Array of Bytes scan and the Assembly scan with no luck. What am I doing wrong?
Request on how to find offsets.
08/29/2008 - Silkroad Online - 0 Replies
Hi can any one please explain how to find the offsets so the mob distance could be increased for auto select. thanks



All times are GMT +2. The time now is 23:55.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.