War Name to Character ID

Results 1 to 19 of 19
  1. #1
    .:[5kR1p7 k1dd13]:. x30unlimited is offline
    MemberRank
    Jan 2009 Join Date
    367Posts

    cool War Name to Character ID

    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 :)

    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 :)
    Last edited by x30unlimited; 27-03-14 at 04:30 PM.


  2. #2
    Valued Member hellred is offline
    MemberRank
    May 2005 Join Date
    razilianLocation
    102Posts

    Re: War Name to Character ID

    x30 you is the best!!!!!!!!!!!!!!!!!!

  3. #3
    Proficient Member hatriks123 is offline
    MemberRank
    Aug 2012 Join Date
    NevarethLocation
    158Posts

    Re: War Name to Character ID

    ty you :)
    great release!
    x30unlimited best ^^

  4. #4
    PwrGames PwrDex is offline
    MemberRank
    Jul 2011 Join Date
    /var/log/cabalLocation
    793Posts

    Re: War Name to Character ID

    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.

  5. #5
    .:[5kR1p7 k1dd13]:. x30unlimited is offline
    MemberRank
    Jan 2009 Join Date
    367Posts

    Re: War Name to Character ID

    Quote Originally Posted by DeXtR View Post
    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

    Quote Originally Posted by DeXtR View Post
    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

    Quote Originally Posted by DeXtR View Post
    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 :)

  6. #6
    █║▌║▌║TheMerc iful║▌║▌║█ 4pLay is offline
    MemberRank
    Jan 2005 Join Date
    DXBLocation
    1,444Posts

    Re: War Name to Character ID

    Quote Originally Posted by x30unlimited View Post
    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!

  7. #7
    .:[5kR1p7 k1dd13]:. x30unlimited is offline
    MemberRank
    Jan 2009 Join Date
    367Posts

    Re: War Name to Character ID

    Quote Originally Posted by 4pLay View Post
    +++ REP FOR YOU!
    <3 thx :P and btw this is also useful for other sv that you play on :D if you see some1 hacking or smthin, simply get the admin/gm to ban the charid :)

    update: added the compiled tool link :D
    Last edited by x30unlimited; 27-03-14 at 04:31 PM.

  8. #8
    Hardcore Member Stricted is offline
    MemberRank
    Feb 2012 Join Date
    GermanyLocation
    234Posts

    Re: War Name to Character ID

    thanks x30unlimited

    and here in php

    PHP Code:
    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);


  9. #9
    .:[5kR1p7 k1dd13]:. x30unlimited is offline
    MemberRank
    Jan 2009 Join Date
    367Posts

    Re: War Name to Character ID

    Quote Originally Posted by Stricted View Post
    PHP Code:
        $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 Code:
    function char2war($id){
        
    $tmp = ($id 0xBC614E ) ^ 0x63783;
        return 
    substr($tmp,6,2).substr($tmp,0,4).substr($tmp,4,2);

    Last edited by x30unlimited; 27-03-14 at 09:23 PM.

  10. #10
    Hardcore Member Stricted is offline
    MemberRank
    Feb 2012 Join Date
    GermanyLocation
    234Posts

    Re: War Name to Character ID

    Quote Originally Posted by x30unlimited View Post
    you do realize that php has substring functions right ? anyway good job :P
    sure but its to easy :D

    no i wanted only translate yours to php without any modification :D

  11. #11
    Apprentice xEXOx is offline
    MemberRank
    Sep 2013 Join Date
    8Posts

    Re: War Name to Character ID

    Thank you so much sir x30unlimited for this release.
    We owe you a lot for this, more power to you sir x30unlimited

  12. #12
    .:[5kR1p7 k1dd13]:. x30unlimited is offline
    MemberRank
    Jan 2009 Join Date
    367Posts

    Re: War Name to Character ID

    Quote Originally Posted by Stricted View Post
    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 by x30unlimited; 27-03-14 at 10:34 PM.

  13. #13
    Valued Member henkypenky is offline
    MemberRank
    Dec 2013 Join Date
    109Posts

    Re: War Name to Character ID

    Thank you very much x30 this will come very handy for improving security :)

    Great release!

  14. #14
    Proficient Member estsoft is offline
    MemberRank
    Jan 2014 Join Date
    154Posts

    Re: War Name to Character ID

    Quote Originally Posted by x30unlimited View Post
    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

  15. #15
    Enthusiast matrocket is offline
    MemberRank
    Jan 2014 Join Date
    31Posts

    Re: War Name to Character ID

    Thanks Great release!

  16. #16
    Valued Member xDarkMoon is offline
    MemberRank
    Nov 2012 Join Date
    The moonLocation
    142Posts

    Re: War Name to Character ID

    This thread has given me hope in humanity.

  17. #17
    Member Tyrant is offline
    MemberRank
    May 2013 Join Date
    79Posts

    Re: War Name to Character ID

    Thanks very much.

  18. #18
    Valued Member CrazyArcad is offline
    MemberRank
    Apr 2007 Join Date
    USALocation
    117Posts

    config Re: War Name to Character ID

    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

  19. #19
    Novice svevil is offline
    MemberRank
    Mar 2012 Join Date
    1Posts

    Re: War Name to Character ID

    Quote Originally Posted by CrazyArcad View Post
    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);
    }



Advertisement