Mikes Native CrossMap Patcher

Posts 115 of 39 · Page 1 of 3
Mikes Native CrossMap Patcher
The Update will come tomorrow and much Scriptkiddy Modder will not know how to update because the SudoMod Base they used is a private Project now, so no support anymore.
Some People might be Happy about this, but here comes the dog in the manger.

How it works:
The Key is only the CrossMapping.cpp not natives.h, in the CrossMapping.cpp you find some Array like this:
Code:
uint64_t __HASHMAPDATA[] = {
           0x0000000000000 ,  0x0000000000000
           ....
};
The left key represents the Initial Hash of the Native which it had on release State (which will used in the natives.h) on the right Side is the actual Hash, which will be the Native which we really will invoke by the CrossMapping.

What you need for this is Alexander Blade's Pastebin of the GTA V Native hash translation table, which he will release 1-2 Days after an Update.
But, the Tables have a Problem, because it translate the Native of the Last Update to the new Update, but our Map is like i said, Initial Hash to new Update Hash, so, i've written a little Tool which can Patch your old CrossMapping.cpp of the last update to the current one.

This Tool will may work with every Update.

So what you have to do now is:
Compile this Tool as Console Application,
copy your CrossMapping.cpp in the same directory like the compiled Binary is, create a File with name "crossmap.txt" (or change the Variable) and paste the PasteBin Output of Alex B in there and run the Tool.
It will create a CrossMapping_new.cpp

In Attachment are example Files included from b791 to b877 (1.36 to 1.37)

Source:
Code:
/* Native CrossMap Patcher by Mike Rohsoft */

#include "stdafx.h"
#include <string>
#include <algorithm>
#include <vector>
#include <sstream>
#include <fstream>
#include <iostream>
#include <map>
#include <regex>
#include <inttypes.h>
#include <Windows.h>
using namespace std;

enum FILEMODE
{
	NEW_CROSS_MAP = 0,
	CPP_CROSS_MAP,
	//NATIVES_H
};

static regex new_cross_map_regexp = regex("\\{\\s*0x0*([1-9a-fA-F][0-9a-fA-F]+)\\s*,\\s*0x0*([1-9a-fA-F][0-9a-fA-F]+)\\s*\\},");
static regex cpp_cross_map_regexp = regex("\\s*0x0*([1-9a-fA-F][0-9a-fA-F]+)\\s*,\\s*0x0*([1-9a-fA-F][0-9a-fA-F]+)\\s*,");
//static regex natives_h_map_regexp = regex("^\\s*static\\s*[a-zA-Z0-9\\*]+\\s*([A-Z0-9_-x]+)\\(.*?(0x[0-9a-fA-F]+).*$");
static vector<string> crossMap;
map<string, string> newkeys;
map<string, string> getMap(FILEMODE mode, string fileName)
{
	map<string, string> ret;
	regex e;
	switch (mode)
	{
	case NEW_CROSS_MAP: e = new_cross_map_regexp; break;
	case CPP_CROSS_MAP: e = cpp_cross_map_regexp; break;
	//case NATIVES_H: e = natives_h_map_regexp; break;
	default: cout << "Error: Unknown Filemode" << endl; exit(1337);
	}	
	ifstream infile(fileName);
	if (infile.good())
	{
		string line;
		string key = "0x";
		string value = "0x";
		cmatch cm;
		int i = 0;
		while (getline(infile, line))
		{
			if (mode == CPP_CROSS_MAP)
				crossMap.push_back(line);
			if (regex_match(&line[0], cm, e, regex_constants::match_default))
			{
				if (mode == NEW_CROSS_MAP)
				{
					key += cm[1];
					value += cm[2];
				}
				else
				{
					key += cm[2];
					value += cm[1];
				}
				transform(key.begin(), key.end(), key.begin(), ::tolower);
				transform(value.begin(), value.end(), value.begin(), ::tolower);
				if (ret.find(key) != ret.end())
				{
					newkeys[value] = value;
				}
				else
					ret[key] = value;
				key = "0x";
				value = "0x";
				i++;
			}
		}
		printf("found %d pairs\n", i);
		infile.close();
	}
	else //if (mode != NATIVES_H)
	{
		cout << "Error: Map File not found: " << fileName << endl;
		exit(1337);
	}
	return ret;
}

string getCurrentPath() 
{
	char buffer[MAX_PATH];
	GetModuleFileNameA(NULL, &buffer[0], MAX_PATH);
	string b = string(&buffer[0]);
	string::size_type pos = b.find_last_of("\\/");
	return b.substr(0, pos) + "\\";
}

const string ALEXANDER_BLADES_PASTBIN_POST_FILE = "crossmap.txt";
const string CODE_CROSSMAP = "CrossMapping.cpp";

int main()
{
	cout << "open file: " << "crossmap.txt" << endl;
	map<string, string> updateMap = getMap(NEW_CROSS_MAP, getCurrentPath() + ALEXANDER_BLADES_PASTBIN_POST_FILE);
	cout << "open file: " << "CrossMapping.cpp" << endl;
	map<string, string> currentMap = getMap(CPP_CROSS_MAP, getCurrentPath() + CODE_CROSSMAP);
	//map<string, string> nativeMap = getMap(NATIVES_H, getCurrentPath() + "natives.h");	
	map<string, string> newMap;
	int patched = 0;
	cout << "Comparing ... ";
	for (map<string, string>::iterator it = updateMap.begin(); it != updateMap.end(); ++it)
	{
		string key = it->first;
		string value = it->second;
		if (currentMap.find(key) != currentMap.end())
		{
			patched++;
			string basekey = currentMap[key];
			newMap[basekey] = value;
		}
	}
	cout << patched << " Natives can be patched..." << endl;
	cmatch cm;
	ofstream out("CrossMapping_new.cpp");
	patched = 0;
	for (int i = 0, l = crossMap.size(); i < l; i++)
	{
		if (regex_match(&crossMap[i][0], cm, cpp_cross_map_regexp, regex_constants::match_default))
		{
			string key = "0x";
			key += cm[1];
			string found = cm[2];
			size_t pos = crossMap[i].find(key) + key.size();
			string value = newMap[key];
			if (value.size() > 0)
			{
				crossMap[i].replace(pos + 2, found.size() + 2, value);
				patched++;
			}
		}
		out << crossMap[i] << endl;
	}
	out.close();
	printf("Done ... patched %d Natives\n", patched);
	string bla;
	getline(cin, bla);
    return 0;
}
Only Text Files, so no Virus Scan
crossmap_natives_patcher_mpgh.net.rar232 KB · 956 downloads Clean
The fact is that no one here knows what this means because this is mainly a skid forum. Either way this is a great release. Thank you
Thanks so much mike. I love u
Quote Originally Posted by jawzainw0123 View Post
Thanks so much mike. I love u
Me
too i want to hump him tho
quite useful. thanks for the release really appreciate it
how use the script?
i not understan
please tell me

- - - Updated - - -

this work in update v1.38?
All i'm reading is 'blah blah blah. blah blah, blah new crossmap blah blah.' @wiro.sableng91 of course you don't understand
its only important for other Developers and / or Scriptkiddys with own Mod Menus
Mike how can i get native translation ? Where is alex will release it? Idk his pastebin user. Sry for my bad english skill.
Quote Originally Posted by jawzainw0123 View Post
Mike how can i get native translation ? Where is alex will release it? Idk his pastebin user. Sry for my bad english skill.
AB will release the new Translation Table at other Forum . search this on Google You might able to find it

[V] Script/Native Documentation and Research
Money machine
i love the menu But if there is a chance can u then make a money drop thing?


Best Modmenu there is undetekted ))))
Quote Originally Posted by No_Pro_DK1 View Post
i love the menu But if there is a chance can u then make a money drop thing?


Best Modmenu there is undetekted ))))
It's dangerous
Gonna take a look when the weekend comes. Nice release.
Posts 115 of 39 · Page 1 of 3

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?