Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

War Name to Character ID

Skilled Illusionist
Joined
Jan 5, 2009
Messages
343
Reaction score
391
Here's a 010 template to get the job done :D
Code:
//--------------------------------------##
// Game: CABAL Online
// Description: Template for War Name to Character ID
//--------------------------------------##
// Author: x30
// Website: http://cabal.ws
//--------------------------------------##

//-Enumerations-------------------------

typedef struct {
   uint value;
} char2war <read=c2wRead>;

typedef struct {
   uint value;
} war2char <read=w2cRead>;

//-Functions----------------------------

string c2wRead(char2war &x) {
    uint realValue = (x.value + 0xBC614E) ^ 0x63783;
    ushort tmp1=realValue / 10000 ;
    ubyte tmp2=(realValue - tmp1 * 10000 ) / 100;
    ubyte tmp3=realValue - tmp1 * 10000 - tmp2 * 100;
    string s;
    SPrintf(s, "%d -> %02d%04d%02d", realValue, tmp3, tmp1, tmp2);
    return s;
}
string w2cRead(war2char &x) {
    ubyte tmp1=x.value / 1000000 ;
    ushort tmp2=(x.value - tmp1 * 1000000 ) / 100;
    ubyte tmp3=x.value - tmp1 * 1000000 - tmp2 * 100;
    uint tmpValue = tmp2*10000+tmp3*100+tmp1;
    uint realValue = (tmpValue  ^ 0x63783) - 0xBC614E;
    string s;
    SPrintf(s, "%04d%02d%02d -> %d", tmp2, tmp3, tmp1, realValue);
    return s;
}

//-Main---------------------------------

char2war chrId;
war2char warId;

And for the lazy fks out there, here's the autoit version
Code:
#NoTrayIcon
$Form1 = GUICreate("x30's War Name Convertor", 221, 71, 274, 393)
$Input1 = GUICtrlCreateInput("CharID", 8, 8, 121, 21)
$Input2 = GUICtrlCreateInput("WarID", 8, 40, 121, 21)
$Button1 = GUICtrlCreateButton("To WarID", 138, 6, 75, 25)
$Button2 = GUICtrlCreateButton("To CharID", 138, 38, 75, 25)
GUISetState(@SW_SHOW)

Func char2war($ID)
	$v=String(BitXOR($ID + 0xBC614E, 0x63783))
	Return StringMid($v,7,2)&StringMid($v,1,4)&StringMid($v,5,2)
EndFunc

Func war2char($ID)
	$v=StringMid($ID,3,4)&StringMid($ID,7,2)&StringMid($ID,1,2)
	Return Int(BitXOR($v, 0x63783) - 0xBC614E)
EndFunc

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $Button1
			GUICtrlSetData($Input2,char2war(GUICtrlRead($Input1)))
		Case $Button2
			GUICtrlSetData($Input1,war2char(GUICtrlRead($Input2)))
		Case -3
			Exit
	EndSwitch
WEnd

Here's the ready to run version for the ones who are even lazier :)
Code:
[URL="http://www.multiupload.nl/XWV68OH2J4"]tool.rar[/URL]

[ATTACH]144598._xfImport[/ATTACH]


This was pretty easy to figure out (tho it took some time), I just put a breakpoint on mem read of charid then changed nation :D the rest was simply a matter of reading the asm :)
 

Attachments

You must be registered for see attachments list
Last edited:
Joined
Jul 24, 2011
Messages
806
Reaction score
615
too soft-hearted with the community.. Other guys think days (like me) to resolve this problem and feel a bit unfair with us this release..
You did a good job anyway just nah. To get this formula need some brain and guys will not use thir own's.
 
Skilled Illusionist
Joined
Jan 5, 2009
Messages
343
Reaction score
391
too soft-hearted with the community..
not really, I hate this community and the stupid fks inside (ofc except a few) but i released this cuz i hate braggers even more :) ppl that pride themselves with some1 else's work :D

Other guys think days (like me) to resolve this problem and feel a bit unfair with us this release..
this is the main reason i released it :) to own ur achievements :p

To get this formula need some brain and guys will not use thir own's.
i don't expect them to use their brain :D most of the rz users don't even have one :)
 
█║▌║▌║TheMerc iful║▌║▌║█
Loyal Member
Joined
Jan 29, 2005
Messages
1,367
Reaction score
80
not really, I hate this community and the stupid fks inside (ofc except a few) but i released this cuz i hate braggers even more :) ppl that pride themselves with some1 else's work :D


this is the main reason i released it :) to own ur achievements :p


i don't expect them to use their brain :D most of the rz users don't even have one :)

hey! love the release even tho i can't use this coz' i don't have a server of my own and even if i have one just going to play solo with my wife!

+++ REP FOR YOU!

thanks!
god bless!
 
Experienced Elementalist
Joined
Feb 16, 2012
Messages
234
Reaction score
96
thanks x30unlimited

and here in php

PHP:
function char2war ($id) {
	$real = ($id + 0xBC614E) ^ 0x63783;
    $tmp1 = round($real / 10000);
    $tmp2 = round(($real - $tmp1 * 10000 ) / 100);
    $tmp3 = round($real - $tmp1 * 10000 - $tmp2 * 100);
	
	return array('charID' => $id, 'warID' => $tmp3.$tmp1.$tmp2);
}
function war2char ($id) {
	$tmp1 = round($id / 1000000);
	$tmp2 = round(($id - $tmp1 * 1000000 ) / 100);
	$tmp3 =round( $id - $tmp1 * 1000000 - $tmp2 * 100);
	$tmpID = $tmp2 * 10000 + $tmp3 * 100 + $tmp1;
	$charID = ($tmpID  ^ 0x63783) - 0xBC614E;
	
	return array('warID' => $id, 'charID' => $charID);
}
 
Skilled Illusionist
Joined
Jan 5, 2009
Messages
343
Reaction score
391
PHP:
    $real = ($id + 0xBC614E) ^ 0x63783;
    $tmp1 = round($real / 10000);
    $tmp2 = round(($real - $tmp1 * 10000 ) / 100);
    $tmp3 = round($real - $tmp1 * 10000 - $tmp2 * 100);
you do realize that php has substring functions right ? anyway good job :p

here's an example
PHP:
function char2war($id){
    $tmp = ($id + 0xBC614E ) ^ 0x63783;
    return substr($tmp,6,2).substr($tmp,0,4).substr($tmp,4,2);
}
 
Last edited:
Newbie Spellweaver
Joined
Sep 20, 2013
Messages
8
Reaction score
0
Thank you so much sir x30unlimited for this release.
We owe you a lot for this, more power to you sir x30unlimited :thumbup1:
 
Skilled Illusionist
Joined
Jan 5, 2009
Messages
343
Reaction score
391
no i wanted only translate yours to php without any modification :D

why didn't you translate the autoit version then ? since it's more efficient ... 010 doesn't have a lot of functions, or i don't know em so good :) anyway irrelevant :p thx for providing a php version
 
Last edited:
Junior Spellweaver
Joined
Jan 16, 2014
Messages
150
Reaction score
189
not really, I hate this community and the stupid fks inside (ofc except a few) but i released this cuz i hate braggers even more :) ppl that pride themselves with some1 else's work :D
this is the main reason i released it :) to own ur achievements :p

This is the exact same reason for me making the 3dsMax importer/exporter scripts. I didn't like RIMBROS lording it over people. Plus, he claims to have spent months and months working on it. It took me a few days :3
 
Junior Spellweaver
Joined
Apr 14, 2007
Messages
109
Reaction score
180
Very Nice Release! Nice Work!

I have to admit that i learned something from this post.

And here is my contribution. (C# Conversion of php code)

Code:
        public static string char2war(string charID)
        {
            int real = Convert.ToInt32(Convert.ToDouble(charID)  + 0xBC614E) ^ 0x63783;
            int tmp1 = Convert.ToInt32(Math.Round((double) (real / 10000)));
            int tmp2 = Convert.ToInt32(Math.Round((double) (real - tmp1 * 10000)) / 100);
            int tmp3 = Convert.ToInt32(Math.Round((double) (real - tmp1  * 10000 - tmp2 * 100)));


            string final = Convert.ToString(tmp3) + Convert.ToString(tmp1) + Convert.ToString(tmp2);


            return final;
        }


        public static string war2char(string charID)
        {
            int tmp1 = Convert.ToInt32(Math.Round(Convert.ToDouble(charID) / 1000000));
            int tmp2 = Convert.ToInt32(Math.Round(Convert.ToDouble(charID) - tmp1 * 1000000) / 100);
            int tmp3 = Convert.ToInt32(Math.Round(Convert.ToDouble(charID) - tmp1 * 1000000 - tmp2 * 100));
            int tmpID = tmp2 * 10000 + tmp3 * 100 + tmp1; 
            charID = Convert.ToString((tmpID ^ 0x63783) - 0xBC614E);
            return charID;
        }

Thanks and props to you for this release x30unlimited
 
Initiate Mage
Joined
Mar 22, 2012
Messages
1
Reaction score
2
Very Nice Release! Nice Work!

I have to admit that i learned something from this post.

And here is my contribution. (C# Conversion of php code)

Code:
        public static string char2war(string charID)
        {
            int real = Convert.ToInt32(Convert.ToDouble(charID)  + 0xBC614E) ^ 0x63783;
            int tmp1 = Convert.ToInt32(Math.Round((double) (real / 10000)));
            int tmp2 = Convert.ToInt32(Math.Round((double) (real - tmp1 * 10000)) / 100);
            int tmp3 = Convert.ToInt32(Math.Round((double) (real - tmp1  * 10000 - tmp2 * 100)));


            string final = Convert.ToString(tmp3) + Convert.ToString(tmp1) + Convert.ToString(tmp2);


            return final;
        }


        public static string war2char(string charID)
        {
            int tmp1 = Convert.ToInt32(Math.Round(Convert.ToDouble(charID) / 1000000));
            int tmp2 = Convert.ToInt32(Math.Round(Convert.ToDouble(charID) - tmp1 * 1000000) / 100);
            int tmp3 = Convert.ToInt32(Math.Round(Convert.ToDouble(charID) - tmp1 * 1000000 - tmp2 * 100));
            int tmpID = tmp2 * 10000 + tmp3 * 100 + tmp1; 
            charID = Convert.ToString((tmpID ^ 0x63783) - 0xBC614E);
            return charID;
        }

Thanks and props to you for this release x30unlimited


Here a C# version with some less code
Code:
private static string char2war(int CharID)
{
    string v = ((CharID + 0xBC614E) ^ 0x63783).ToString();
    v = v.PadLeft(9, '0');
    return v.Substring(7, 2) + v.Substring(1, 4) + v.Substring(5, 2);
}

private static int war2char(string WarID)
{
    WarID = WarID.PadLeft(9, '0');
    string v = (WarID.Substring(3, 4) + WarID.Substring(7, 2) + WarID.Substring(1, 2));
    return ((Convert.ToInt32(v) ^ 0x63783) - 0xBC614E);
}
 
Elite Diviner
Joined
Jun 18, 2023
Messages
436
Reaction score
245
Sorry but anyone has compiled of this program? Thanks.
 
Back
Top