![]() |
|
|
|
|
#1 |
|
Архивный участник
Join Date: Apr 2005
Posts: 314
|
First, I don't know how you can find that. It is just luck or skill or both. I will just explain what do you need to change and why do you need to change that.
Task: add new crystal_type property value. Just add. Nothing more. Hex is a bit incomplete, ex. if you crush item with new cryst. type you will either get crash or bunch of no-crystal thing. A bit of theory: Server parses all script files and stores them in memory. It stores those in rather... complex format, but most of properties are being saved as word or dword (since c works with numbers faster). There is a function, actually, that converts string assigned to property into numeric value. And it is resided in here : 00567840. So, all we need is to read this function carefully and understand what actually does it do. Consider that as your hometask. I will stop only on moments needed for our task. Practice? First, if you read that one carefuly, you can understand how it works. It checks on appropriate string in table and substitutes it with appropriate numeric value. Also, it makes 80h cycles, meaning that it's for-loop. This: Code:
00567849 |. BE 4C566C00 MOV ESI,L2server.006C564C Second, what's length of our table item and its structure? Code:
00567850 |> /396E FC /CMP DWORD PTR DS:[ESI-4],EBP ;check if table item is referenced to proerty field we have. Notice [esi-4]! 00567853 |. /75 14 |JNE SHORT L2server.00567869 ;if it's not, jump 00567855 |. |8B06 |MOV EAX,DWORD PTR DS:[ESI] ;Get first element of table item to eax 00567857 |. |85C0 |TEST EAX,EAX ; Check if it's NULL 00567859 |. |74 1A |JE SHORT L2server.00567875 ; if it is, break; exit; return error. 0056785B |. |53 |PUSH EBX ;in [EBX] you have string from .txt 0056785C |. |50 |PUSH EAX ;in EAX you have first element of table item 0056785D |. |E8 4E350300 |CALL <L2server.cmpstr> ; it is standart VC++ compare string routine. Every hexer should recognize it from first sight. Consider it as your hometask. 00567862 |. |83C4 08 |ADD ESP,8 ; Shift Stack by 8 (2 values we pushed earlier) 00567865 |. |85C0 |TEST EAX,EAX ; Check if function returned NULL* 00567867 |. |74 16 |JE SHORT L2server.0056787F ; If it did, then strings are equal. Exit cycle. 00567869 |> \47 |INC EDI ; increment for-loop variable by one 0056786A |. 83C6 10 |ADD ESI,10 ; add 10h to table pointer** 0056786D 81FF 80000000 CMP EDI,80 ; check if we've got for-loop variable = 80h 00567873 |.^ 72 DB \JB SHORT L2server.00567850 ; if not, continue on cycle. **Which means we increment table item pointer by one. Which means that one table item is 10h = 16 bytes long. Now, let's see to code which is being executed when we got strings matched. Code:
0056787F |> \C1E7 04 SHL EDI,4 ;this actually means "divide EDI by 2^4 and take whole part" = [EDI/16] 00567882 |. 8B87 50566C00 MOV EAX,DWORD PTR DS:[EDI+6C5650] ;EDI+006C564C+4. Obviously, second element of item we exited on. 00567888 |. 8B97 54566C00 MOV EDX,DWORD PTR DS:[EDI+6C5654] ;Obviously, third element of item we exited on. This means that function returns two values in EAX and EDX. First one is dword value of string. Second... I don't know, but in this context it doesn't matter (if you're curious, look what is that in near of .568CB5. That's where this function is being called and EDI is being used). So, we need 1) add new element to table in format: (int field, PWideChar StringValue, int DwordValue, int Unknown=0) 2) Increase loop count by one. Second is easy. Change Code:
0056786D 81FF 80000000 CMP EDI,80 Code:
0056786D 81FF 80000000 CMP EDI,81 I just added it at the end of table, like that: Code:
006C5E48: 26000000 585E6C00 06000000 00000000 int field = 26h (which is crystal_type) PWideChar StringValue = 6C5E58 = UNICODE 'e' int DwordValue = 6 int Unknown = 0 It is also possible to move table somewhere else, where is more space if you need it. In this case, we did not. Well... I think that's all. Any feedback is welcomed. Software I usually get asked what soft do I use. I always answer, but it gets annoying, so I want to make it clear. I use ollydbg 1.10 for debugging, often hexing, usually to post my hexes here. I use Hex workshop to search for strings and cross-section references. I use hiew to hex fast fixes in different versions of exes. Stop. Nothing more. |
|
|
|
|
#2 |
|
Архивный участник
Join Date: May 2005
Posts: 463
|
thaks for help to comunity.. nice tutorial..
thanks again
|
|
|
|
|
#3 |
|
Архивный участник
Join Date: May 2005
Posts: 367
|
Novice
change item 5789,5790,2369,10,6,2370 to crystal_type=e from crystal_type=none now novice SS can be used only in starting weapons also edit consume |
|
|
|
|
#4 |
|
Архивный участник
Join Date: Apr 2005
Posts: 314
|
... Thought I'll bump this thread. Just in case.
166 views and 2 posts... I fear people look and think: "I don't understand a word" and go out. |
|
|
|
|
#5 |
|
Архивный участник
Join Date: Jun 2005
Posts: 199
|
woo coollll, thanks livid
|
|
|
|
|
#6 | |
|
Архивный участник
Join Date: Jun 2005
Posts: 374
|
Quote:
|
|
|
|
|
|
#7 |
|
Архивный участник
Join Date: Sep 2005
Posts: 408
|
Starter weapons use soulshot_none_for_rookie etc. I believe he's trying to allow them to use these or something.
|
|
|
|
|
#8 |
|
Архивный участник
Join Date: Jun 2005
Posts: 374
|
Starter weapons use no grade soulshots, the soulshot_none_for_rookie are the same as no grade soulshots, but they just don't weigh as much and you get them with quests. There is no difference in crystal_type on retail; you can use the rookie soulshots with i.e. a comp bow if you'd like.
|
|
|
|
|
#9 |
|
Архивный участник
Join Date: Apr 2005
Posts: 314
|
I belive you can use rookie soulshots/spiritshots only with limited ammount of weapons. Specifically with some of weapons that do not use normal soulshots/spss.
And you get rookie SS only for tutorial quest (as a part of tutorial actually) that was the point. |
|
|
|
|
#10 |
|
Архивный участник
Join Date: Sep 2005
Posts: 408
|
ty for clarifying
|
|
|
|
|
#11 |
|
Архивный участник
Join Date: Jul 2005
Posts: 371
|
wow, nice hex livid
|
|
|
|
|
#12 |
|
Архивный участник
Join Date: Jul 2005
Posts: 371
|
For some people this might be useful, just finished a dll to do it automaticly
i dont gurantee the code works ![]() Code:
//ITEMDATA
typedef struct{
DWORD field;
LPWSTR string;
DWORD value;
DWORD empty;
} ITEMDATA, *LPITEMDATA;
void copyBlock(LPDWORD destination, const DWORD* source, int _size)
{
for(int i=_size>>2;--i>=0;) {
*destination = *source;
destination += 4;
source += 4;
}
}
void replaceByte(LPDWORD destination, BYTE data)
{
*destination = data;
}
L2EXT_API void parseItemData()
{
int ItemDataType
LPITEMDATA _lpDwords;
LPITEMDATA _lpCopy = new ITEMDATA();
LPDWORD _lpCounter;
__asm
{
mov _lpDwords, 0x6C5E48;
mov _lpCounter, 0x56786F;
mov ItemDataType, eax;
}
copyBlock((LPDWORD)_lpCopy, (LPDWORD)_lpDwords, 16);
_lpDwords->field = 0x26;
_lpDwords->string = 0x6C5E58;
_lpDwords->value = 0x06;
_lpDwords->empty = 0;
replaceByte(_lpCounter, 0x81);
__asm {
push ItemDataType;
CALL _fnItemDataParser;
ADD ESP,4;
push eax
}
replaceByte(_lpCounter, 0x80);
copyBlock((LPDWORD)_lpDwords,(LPDWORD)_lpCopy, 16);
delete _lpCopy;
_asm pop eax;
}
|
|
|
|
|
#13 |
|
Архивный участник
Join Date: Aug 2005
Posts: 605
|
A big thanks to you for your help ^^ Do you guys imagine what would happen if ppl like livid and torune had the c3 source in theri hands.wohooo! Keep up the good work guys
|
|
|
|
|
#14 |
|
Архивный участник
Join Date: Apr 2005
Posts: 599
|
Livid and torune, you are the most shared in hexing. Help me if you can
in full party - should be a bonus 90% of exp for full paty - in my server have bonus too - 7% (i think so ) question: Where i shold increse parametr for this?sory for my bad english. rus Пати бонус - должно быть 90% если полная пати говарят что есть 7% как сделать 90%? |
|
|
|
|
#15 |
|
Архивный участник
Join Date: Sep 2005
Posts: 408
|
try making a new post instead of going offtopic
|
|
|
|
|
#16 |
|
Архивный участник
Join Date: Sep 2005
Posts: 731
|
Tnx for the share Livid !!!
|
|
|
|
|
#17 |
|
Guest
Posts: n/a
|
Sorry, but i dont find post about novice SS|BSPS...
It deleted ? P.S. Ill try search - dont found =( |
|
|
#18 |
|
Архивный участник
Join Date: Sep 2005
Posts: 408
|
Novice ss/bsps are identical to no graed except for the name.
Could this be used for fishing rods? They all have their own grades and use fishing shots. I know this is for adding a new grade, but what about adding a new wepaon type of ROD? |
|
|
|
|
#19 |
|
Архивный участник
Join Date: Nov 2005
Posts: 15
|
Novice ss/bsps are identical to no graed except for the name.
does it mean that any wearpon (not just starter, but any) can be charged with Novice ss/bsps? |
|
|
|
|
#20 |
|
Архивный участник
Join Date: Jun 2005
Posts: 374
|
Yes. That's what I've been saying from the start...
|
|
|
|
|
#21 |
|
Guest
Posts: n/a
|
|
|
|
#22 |
|
Архивный участник
Join Date: May 2005
Posts: 979
|
SS for rookie are weaker than normal SS none..
|
|
|
|
|
#23 |
|
Архивный участник
Join Date: Mar 2005
Posts: 107
|
Livid, nice Tutorial.
It makes us take courage and start to learn ASM and try to hex L2. |
|
|
|
|
#24 |
|
Архивный участник
Join Date: Apr 2005
Posts: 75
|
livid can u add a new crystal higher than S grade (becouse crystal E is lower than D) , i was thinking on use a new crystal H (for example) for hero weapons , and make a new expertise H for hero , so then can use hero weapons and hero sets
|
|
|
|
|
#25 | ||
|
Архивный участник
Join Date: Sep 2005
Posts: 408
|
Quote:
![]() Quote:
|
||
|
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|