Here's a 010 template to get the job done :D
And for the lazy fks out there, here's the autoit versionCode://--------------------------------------## // 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;
Here's the ready to run version for the ones who are even lazier :)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
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 :)


Reply With Quote


