• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

GameServer 1.00.90

Junior Spellweaver
Joined
Jul 11, 2006
Messages
188
Reaction score
184
This is my tokenizer
Makes easier to load bags or things like that... ;P

Code:
#pragma once

#include <map>
#include <iostream>
#include <fstream>
#include <string>
#include <boost/tokenizer.hpp>
#include <boost/algorithm/string.hpp>

namespace DarKTeaM {

class TokenizerField
{
protected:
	std::string Value;

public:
	TokenizerField();
	TokenizerField(std::string Val);

	int	ToInteger();
	long ToLong();
	double ToDouble();
	float ToFloat();
	std::string ToString();
	char* ToStringPtr();

};

class TokenizerRow
{
public:
	std::map<int, TokenizerField>	Fields;
	int									FieldCount;

public:
	TokenizerRow();
	TokenizerRow(std::string strLine);

	TokenizerField& operator[] (int FieldIndex);

	char*		GetField(int FieldIndex, char* Default);
	std::string	GetField(int FieldIndex, std::string Default);
	float		GetField(int FieldIndex, float Default);
	int			GetField(int FieldIndex, int Default);
	long		GetField(int FieldIndex, long Default);
	double		GetField(int FieldIndex, double Default);

	bool FieldExists(int FieldIndex);

};

class TokenizerSection
{
public:
	std::map<int, TokenizerRow>		Rows;
	int								RowCount;

public:
	TokenizerSection();
	TokenizerRow&	operator[] (int RowIndex);
	bool RowExists(int RowIndex);

};

class Tokenizer
{
public:
	std::map<int, TokenizerSection>	Sections;
	bool									Loaded;

public:
	Tokenizer(std::string szFile);
	TokenizerSection& operator[](int SectionIndex);
	bool SectionExists(int SectionIndex);

};


TokenizerField::TokenizerField() {
	this->Value = "";
}
TokenizerField::TokenizerField(std::string Val) {
	this->Value = Val;
}
int	TokenizerField::ToInteger() {
	return atoi(this->Value.c_str());
}
long TokenizerField::ToLong() {
	return atol(this->Value.c_str());
}
double TokenizerField::ToDouble() {
	return atof(this->Value.c_str());
}
float TokenizerField::ToFloat() {
	return (float)(atof(this->Value.c_str()));
}
std::string TokenizerField::ToString() {
	return this->Value;
}
char* TokenizerField::ToStringPtr() {
	return (char*)this->Value.c_str();
}

TokenizerRow::TokenizerRow()
{
	this->FieldCount = 0;
}

TokenizerField& TokenizerRow::operator [](int FieldIndex)
{
	return this->Fields[FieldIndex];
}

char* TokenizerRow::GetField (int FieldIndex, char* Default)
{
	if(!this->FieldExists(FieldIndex)) return Default;
	return this->Fields[FieldIndex].ToStringPtr();
}

std::string TokenizerRow::GetField (int FieldIndex, std::string Default)
{
	if(!this->FieldExists(FieldIndex)) return Default;
	return this->Fields[FieldIndex].ToString();
}

float TokenizerRow::GetField (int FieldIndex, float Default)
{
	if(!this->FieldExists(FieldIndex)) return Default;
	return this->Fields[FieldIndex].ToFloat();
}

int TokenizerRow::GetField (int FieldIndex, int Default)
{
	if(!this->FieldExists(FieldIndex)) return Default;
	return this->Fields[FieldIndex].ToInteger();
}

long TokenizerRow::GetField (int FieldIndex, long Default)
{
	if(!this->FieldExists(FieldIndex)) return Default;
	return this->Fields[FieldIndex].ToLong();
}

double TokenizerRow::GetField (int FieldIndex, double Default)
{
	if(!this->FieldExists(FieldIndex)) return Default;
	return this->Fields[FieldIndex].ToDouble();
}


TokenizerRow::TokenizerRow(std::string strLine)
{

	this->FieldCount = 0;

	std::string sep1 = "\\";
	std::string sep2 = " \t";
	std::string sep3 = "\"";
	boost::escaped_list_separator<char> sep(sep1, sep2, sep3);
	boost::tokenizer<boost::escaped_list_separator<char> > tok(strLine, sep);

	for (boost::tokenizer<boost::escaped_list_separator<char> >::iterator it = tok.begin(); 
		it != tok.end(); ++it)
	{
		if(*it == "") continue;
		this->Fields[this->FieldCount++] = TokenizerField(std::string(*it));
	}

}


bool TokenizerRow::FieldExists(int FieldIndex)
{
	std::map<int, TokenizerField>::iterator it = this->Fields.find(FieldIndex);
	return (bool)(it != this->Fields.end());
}

TokenizerSection::TokenizerSection()
{
	this->Rows.clear();
	this->RowCount = 0;
}
TokenizerRow& TokenizerSection::operator[] (int RowIndex)
{
	return this->Rows[RowIndex];
}

bool TokenizerSection::RowExists(int RowIndex)
{
	std::map<int, TokenizerRow>::iterator it = this->Rows.find(RowIndex);
	return (bool)(it != this->Rows.end());
}

Tokenizer::Tokenizer(std::string szFile)
{
	this->Loaded = false;
	std::fstream f(szFile.c_str(), std::ios::in);
	if(f.is_open() && f.good())
	{

		TokenizerSection sec = TokenizerSection();

		int CurrentSection = 0;
		int RowIndex = 0;
		bool SectionOpen = false;

		while(!f.eof())
		{

			char temp[4096];
			char* dump = NULL;
			std::string line = "";
			ZeroMemory(&temp[0], 4096);
			f.getline(&temp[0], 4095);
			line.assign(&temp[0]);
			dump = (char*)line.c_str();

			bool finishstart = false;
			bool finishend = false;

			while(true)
			{
				if(line.length() > 0)
				{
					if(line.at(0) == ' ' || line.at(0) == '\t')	
					{
						line.erase(0, 1);
					}
					else
					{
						if(finishend == true) break;
						finishstart = true;
					}
				}
				else
				{
					break;
				}
				if(line.length() > 0)
				{
					if(line.at(line.length()-1) == ' ' || line.at(line.length()-1) == '\t')	
					{
						line.erase(line.length()-1, 1);
					}
					else
					{
						if(finishstart == true) break;
						finishend = true;
					}
				}
				else
				{
					break;
				}
			}

			if(	line.substr(0, 2) == "//" || line.substr(0, 1) == "#" || line == "" )	
			{
				continue;
			}

			TokenizerRow row(line);

			if(SectionOpen == false)
			{
				if(row.FieldCount == 2)
				{
					if(row[1].ToString() == "{")
					{
						//MessageBox(0, "Abrindo seção", "Seção", MB_OK);
						CurrentSection = row[0].ToInteger();
						SectionOpen = true;
						RowIndex = 0;
					}
				}
			}
			else
			{
				if(row.FieldCount == 1)
				{
					if(row[0].ToString() == "}" && SectionOpen == true)
					{
						//MessageBox(0, "Fechando", "Seção", MB_OK);
						this->Sections[CurrentSection] = sec;
						sec = TokenizerSection();
						SectionOpen = false;
						continue;
					}
				}
				sec[RowIndex++] = row;
				sec.RowCount++;
			}

		}
		this->Loaded = true;
	}

}

TokenizerSection& Tokenizer::operator[](int SectionIndex)
{
	return this->Sections[SectionIndex];
}

bool Tokenizer::SectionExists(int SectionIndex)
{
	std::map<int, TokenizerSection>::iterator it = this->Sections.find(SectionIndex);
	return (bool)(this->Sections.end() != it);
}


/*
	Programado por WoLf
	Versão antiga!


class TokenizerRow
{
public:
	std::map<DWORD, std::string>	Columns;
	int	ColumnCount;

	std::string GetString(DWORD Column, std::string Default = "")
	{
		std::map<DWORD, std::string>::iterator it = this->Columns.find(Column);
		if(it == this->Columns.end())
		{
			return Default;
		}
		return it->second;
	}

	char* GetStringPtr(DWORD Column, std::string Default = "")
	{
		std::map<DWORD, std::string>::iterator it = this->Columns.find(Column);
		if(it == this->Columns.end())
		{
			return (char*)Default.c_str();
		}
		return (char*)it->second.c_str();
	}

	int GetInt(DWORD Column, DWORD Default = -1, BOOL Hex = FALSE)
	{
		
		std::map<DWORD, std::string>::iterator it = this->Columns.find(Column);
		
		if(it == this->Columns.end())
		{
			return Default;
		}

		if(Hex)
		{
			unsigned int pOffset = Default;
			sscanf_s(it->second.c_str(), "%x", &pOffset);
			return pOffset;
		}

		return atoi(it->second.c_str());

	}

	double GetFloat(DWORD Column, double Default = 0.0f)
	{
		std::map<DWORD, std::string>::iterator it = this->Columns.find(Column);
		if(it == this->Columns.end())
		{
			return Default;
		}
		return atof(it->second.c_str());
	}

};

class TokenizerSection
{
public:
	std::map<DWORD, TokenizerRow>	Rows;
	int							RowCount;
};

class TokenizerGroup
{
public:
	std::map<DWORD, TokenizerSection>	Sections;

	bool GetSection(DWORD Index, TokenizerSection & section)
	{
		std::map<DWORD, TokenizerSection>::iterator it = this->Sections.find(Index);
		if(it == this->Sections.end())
		{
			return false;
		}
		else
		{
			section = it->second;
			return true;
		}
	}

};

class Tokenizer
{
private:
	char*	m_pBuffer;
	DWORD	m_pBufferSize;
	DWORD	m_pBufferIndex;

public:

	bool ParseLine(std::string line, TokenizerRow & pRow)
	{

		std::string data = "";

		char* dump = (char*)line.c_str();
		
		bool openstring = false;
		bool clearingspace = true;
		
		int column = 0;

		for(unsigned int i = 0; i < line.length(); i++)
		{

			if(clearingspace)
			{
				if(dump[i] == ' ' || dump[i] == '\t')
				{
					continue;
				}
				clearingspace = false;
			}

			if(openstring)
			{
				if(dump[i] == '"')
				{
					openstring = false;
					continue;
				}
				data += dump[i];
			}
			else
			{
				if(dump[i] == '"')
				{
					if(data != "")
					{
						return false;
					}
					openstring = true;
					continue;
				}
				else
				{
					if(dump[i] == '\t' || dump[i] == ' ')
					{
						if(data != "")
						{
							pRow.Columns[column++] = data;
							data = "";
						}
						continue;
					}   
					data += dump[i];
				}
			}

		}

		if(data != "")
		{
			pRow.Columns[column++] = data;
		}

		data = "";

		pRow.ColumnCount = column;

		return true;

	}

	bool ParseFile(std::string file, TokenizerGroup & tok)
	{

		std::fstream f(file.c_str(), std::ios::in);

		if(f.is_open())
		{

			if(f.good())
			{

				TokenizerSection sec = TokenizerSection();
				int current_sec = 0;
				int sec_index = 0;
				bool sec_open = false;

				while(!f.eof())
				{

					char temp[4096];
					char* dump = NULL;
					std::string line = "";

					ZeroMemory(&temp[0], 4096);

					f.getline(&temp[0], 4095);
					line.assign(&temp[0]);

					dump = (char*)line.c_str();

					int start = 0;
					int end = 0;

					for(DWORD i = 0; i < line.length(); i++)
					{
						if(dump[i] != ' ' && dump[i] != '\t')
						{
							break;
						}
						start++;
					}

					for(DWORD i = line.length()-1; i >= 0; i--)
					{
						if(dump[i] != ' ' && dump[i] != '\t')
						{
							break;
						}
						end++;
					}

					line = line.substr(start, line.length() - end - start);

					std::string::size_type k = 0;
					while((k=line.find(13,k))!=line.npos) 
					{
						line.erase(k, 1);
					}

					if(line.substr(0, 2) == "//") continue;
					if(line[0] == '#') continue;

					if(line.compare("end") == false)
					{
						if(sec_open == false) 
						{
							return false; // falha de sintaxe
						}
						sec_open = false;
						sec.RowCount = sec_index;
						tok.Sections[current_sec] = sec;
						continue;
					}
					
					if(line == "") continue;

					TokenizerRow row;
					if(!this->ParseLine(line, row))
						return false;

					if(row.ColumnCount == 1)
					{
						if(sec_open == false)
						{
							sec_index = 0;
							current_sec = row.GetInt(0, 0);
							sec = TokenizerSection();
							sec_open = true;
							continue;
						}
					}

					sec.Rows[sec_index++] = row;

				}

			}
			else
			{
				f.close();
				return false;
			}
			
			f.close();

			return true;

		}
		else
		{
			return false;
		}

	}

};
*/

}

ps. the current code parses files like these:

Code:
# comment line
// comment line
0 {
    12345    1234.5    "string column"
}

and big commented section contains code for parsing webzen style files... and doesn't uses boost::tokenizer, but i don't recommend using it because of memory leaks

Code:
0
    12345    1234.5    "string column"
end

!!comments after columns are not supported!!

like:

Code:
0 {
    col1    col2    col3  // comment
}

-----------
simple usage:

Code:
DarKTeaM::Tokenizer token ("parsethis.txt");
token[0] = access to section 0
token[0][0] = access to section 0, and row 0
token[0][0][0] = access to section 0, row 0, and column 0
token[0][0][0].Function() = where function is your requested type... line ToInteger(), ToString(), etc...

there are some functions for checking row count, column count, section count, if it exists or not, and things like that... but let intellisense help you with that :p


if you can't compile it, its not my fault...
btw, you'll need boost lib installed... :rolleyes:
 
Junior Spellweaver
Joined
Jul 11, 2006
Messages
188
Reaction score
184
wolfulus, hades project is dead or not?

it isn't... I'm currently reworking my antihack system (some servers requested me to), and a project for university are taking my time to... I'll start working on it again when I finish the antihack and the university project.

I'll post the network engine source code this week maybe, or next one.

Ps. I haven't posted any news, since no one cares about it, I dont care too :p

[]'s
 
Newbie Spellweaver
Joined
Sep 20, 2004
Messages
67
Reaction score
3
MU JPN 1.03A+ FULL CLIENT

ORIGINAL LINK



---------- Post added at 02:43 PM ---------- Previous post was at 02:42 PM ----------

MU JPN 1.03A+ FULL CLIENT

ORIGINAL LINK


TY. I couldn't get my usual JPN proxies working.



Also, I think it's about time another GS got leaked...
 
Newbie Spellweaver
Joined
Sep 9, 2006
Messages
54
Reaction score
6
wolfulus, Why do you think that no one cares? I think many people watching your project. silently :)
where i can read about your antihack system? it's private?


slyfox125, use this proxies
 
Newbie Spellweaver
Joined
Feb 3, 2009
Messages
8
Reaction score
1
this it my first post...
for those who have trouble compiling of ACGSeason5Premium Sources, i read in x-mu.net (Russia forum) that we have to do the next:

* In the project:
Delete:
Code:
Security.h and Security.cpp

*In Header Files > StdAfx.h
Delete:
Code:
#include "security.h"

*In Header Files > User.h
Add a line with:
Code:
 #define MAX_PLAYERID 9000

*In Header Files > Utils.h
Add a line with:
Code:
#include "User.h"

*In Source Files > GameServer.cpp
Delete:
Code:
// Cheking Mac Protections
if(Check(1)) {
Checking = 1;
}
if(!Check(0)) {
Checking = 0;
}

With that we have not more problems :8::thumbup::8:

sorry for my bad English, this is because I'm from Argentina and speak Spanish not English really: P
 
Last edited:
Newbie Spellweaver
Joined
Sep 9, 2006
Messages
54
Reaction score
6
maybe someone have Dark Raven dmg and speed formula's offset? or how to find it
 
Newbie Spellweaver
Joined
Jul 18, 2010
Messages
31
Reaction score
11
cant register lucky coins in delgado npc :/
does anyone know why?
I can exchange the coins, but cant register it.
Maybe some table is missing, but I dont get any errors in eventserver when I try to register the coins :/
 
Junior Spellweaver
Joined
Jun 10, 2006
Messages
136
Reaction score
100
It's not a big difference if struct will look like this
Code:
struct PMSG_GENS_INFO
{
PGMSG_HEADER h;
BYTE GensType; //4
BYTE null1;
BYTE null2;
BYTE null3;
int Ranking; //8
int Symbol; //12
int Contribution; //16
int NextContrib; //20
};

or like this

Code:
struct PMSG_GENS_INFO
{
PGMSG_HEADER h;
int GensType; //4
int Ranking; //8
int Symbol; //12
int Contribution; //16
int NextContrib; //20
};

This last 3 bytes are not used in protocol...

So if one bug put more than 255 in GensType it will accept and client will do something wrong... So isn´t like one or other....
 
Experienced Elementalist
Joined
May 27, 2006
Messages
211
Reaction score
34
So, has anyone got the new JPN client working fully?

new jpn client will work

Warp without Seal of Mobility
0079676E |. /7D 2D |JGE SHORT main.0079679D 7D 2D ----> EB 27
00796770 |. |8B4D FC |MOV ECX,[LOCAL.1]
00796773 |. |C1E1 04 |SHL ECX,4
00796776 |. |81C1 001A2009 |ADD ECX,main.09201A00
0079677C |. |E8 BFB4C6FF |CALL main.00401C40
00796781 |. |50 |PUSH EAX
00796782 |. |8B4D 08 |MOV ECX,[ARG.1]
00796785 |. |E8 B6B4C6FF |CALL main.00401C40



Fixing Mastering Level Show
1. Open your main with OllyDBG.

2. Search for string : "----------".

3. Double click on it and will appear the ASM code with what we need.

# Main have 2 ways to show the level : using level number or using Master word.
-> So to fix this bug we just need to fill with NOPs the CALL and JMP used for show master word.

Offsets:
00730FD4 |. E8 D77ED9FF CALL main.004C8EB0 ; \main.004C8EB0 Right Click > Edit > Fill with NOPs show Level
00730FD9 |. 83C4 08 ADD ESP,8
00730FDC |. EB 5E JMP SHORT main.0073103C Right Click > Edit > Fill with NOPs show Master word
00730FDE |> 8B0D C021B907 MOV ECX,DWORD PTR DS:[7B921C0]


About CashShop, you need to modify cashshop protocol in GS
 
Last edited:
Newbie Spellweaver
Joined
Sep 9, 2006
Messages
54
Reaction score
6
btw, problem is not in Seal of Mobility System, but in M menu
M menu don't work without Seal of Mobility and with him


JoniverPH, have M menu fix for 1.03U client?
 
Experienced Elementalist
Joined
May 27, 2006
Messages
211
Reaction score
34
btw, problem is not in Seal of Mobility System, but in M menu
M menu don't work without Seal of Mobility and with him


JoniverPH, have M menu fix for 1.03U client?

Main 1.03U JPN M Menu fix

Ollydbg
0077F7AB |. /7D 2D |JGE SHORT main.0077F7DA Change to EB 27
0077F7AD |. |8B4D FC |MOV ECX,[LOCAL.1]
0077F7B0 |. |C1E1 04 |SHL ECX,4
0077F7B3 |. |81C1 E81B2009 |ADD ECX,main.09201BE8
0077F7B9 |. |E8 2225C8FF |CALL main.00401CE0
0077F7BE |. |50 |PUSH EAX
0077F7BF |. |8B4D 08 |MOV ECX,[ARG.1]
0077F7C2 |. |E8 1925C8FF |CALL main.00401CE0
0077F7C7 |. |50 |PUSH EAX
0077F7C8 |. |E8 E37F1300 |CALL main.008B77B0


Hex Offset 0077F7AB
Search
7D 2D 8B 4D FC C1 E1 04

Replace
EB 27 8B 4D FC C1 E1 04
Didn't Test Tell me if work :thumbup:
 
Last edited:
Newbie Spellweaver
Joined
Sep 9, 2006
Messages
54
Reaction score
6
JoniverPH, now M menu is acessible(no red colored disabled elements) without Seal, but don't work teleport when i press location names in M menu.
 
Back
Top