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!

Protocol new fuction for coderz.

Newbie Spellweaver
Joined
Sep 25, 2005
Messages
78
Reaction score
1
Well hi to all coders, i had been hear than some teams got freaking troubles on understand how new protocol for items works for new clients, so i develop some weeks ago this fuction for reeplase some old one in GS and it will help alot to coders on change the protocol to new clients, so here i left it:

Code:
.Const
ITEMSECTIONSPACE Equ 40H
ITEMINDEXSPACE Equ 40H

.Data
ItemSection DB ITEMSECTIONSPACE Dup(0)
GlobalItemIndex DB ITEMINDEXSPACE Dup(0)

CalculateItemID Proc
Local CMyItemID:DWord
Local CMyItemIndex:DWord
 Push Ebx
 Push Esi
 Push Edi
 Mov Ecx, DWord Ptr Ss:[Ebp + 8H]
 Mov CMyItemID, Ecx
 Xor Eax, Eax
 Mov Eax, 1
 Cmp Ecx, 0
 Je CalculateItemIDEnd
 Xor Eax, Eax
CSubNumbers:
 Add Eax, 1
 Sub Ecx, 10H
 Cmp Ecx, 0
 Je CMoveItemID
 Cmp Ecx, 0FFFFFFFFH
 Jle CMoveItemID
 Jmp CSubNumbers
CMoveItemID:
 Mov Ecx, CMyItemID
 Cmp Ecx, 1FH
 Jle CDecreaseBytebyone
 Cmp Ecx, 21H
 Jge CCheckAll
 Jmp CCalculateItemSection
CCheckAll:
 Cmp Ecx, 20H
 Je CCalculateItemSection
 Cmp Ecx, 40H
 Je CCalculateItemSection
 Cmp Ecx, 60H
 Je CCalculateItemSection
 Cmp Ecx, 80H
 Je CCalculateItemSection
 Cmp Ecx, 0A0H
 Je CCalculateItemSection
 Cmp Ecx, 0C0H
 Je CCalculateItemSection
 Cmp Ecx, 0E0H
 Je CCalculateItemSection
 Cmp Ecx, 100H
 Je CCalculateItemSection
 Cmp Ecx, 120H
 Je CCalculateItemSection
 Cmp Ecx, 140H
 Je CCalculateItemSection
 Cmp Ecx, 160H
 Je CCalculateItemSection
 Cmp Ecx, 180H
 Je CCalculateItemSection
 Cmp Ecx, 1A0H
 Je CCalculateItemSection
 Cmp Ecx, 1C0H
 Je CCalculateItemSection
 Cmp Ecx, 1E0H
 Je CCalculateItemSection
CDecreaseBytebyone:
 Sub Eax, 1
CCalculateItemSection:
 IMul Eax, Eax, 10H
 Mov CMyItemIndex, Eax
 Mov Ecx, CMyItemID
 Sub Ecx, Eax
 Mov DWord Ptr GlobalItemIndex, Ecx
CheckByteSection:
 Mov Eax, CMyItemIndex
 Cmp Eax, 10H
 Je Cits0
 Cmp Eax, 20H
 Je Cits10
 Cmp Eax, 40H
 Je Cits20
 Cmp Eax, 60H
 Je Cits30
 Cmp Eax, 80H
 Je Cits40
 Cmp Eax, 0A0H
 Je Cits50
 Cmp Eax, 0C0H
 Je Cits60
 Cmp Eax, 0E0H
 Je Cits70
 Cmp Eax, 100H
 Je Cits80
 Cmp Eax, 120H
 Je Cits90
 Cmp Eax, 140H
 Je Cits100
 Cmp Eax, 160H
 Je Cits110
 Cmp Eax, 180H
 Je Cits120
 Cmp Eax, 1A0H
 Je Cits130
 Cmp Eax, 1C0H
 Je Cits140
 Cmp Eax, 1E0H
 Je Cits150
 Xor Eax, Eax
 Jmp CalculateItemIDEnd
Cits0:
 Mov ItemSection, 0
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits10:
 Mov ItemSection, 10H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits20:
 Mov ItemSection, 20H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits30:
 Mov ItemSection, 30H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits40:
 Mov ItemSection, 40H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits50:
 Mov ItemSection, 50H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits60:
 Mov ItemSection, 60H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits70:
 Mov ItemSection, 70H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits80:
 Mov ItemSection, 80H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits90:
 Mov ItemSection, 90H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits100:
 Mov ItemSection, 0A0H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits110:
 Mov ItemSection, 0B0H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits120:
 Mov ItemSection, 0C0H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits130:
 Mov ItemSection, 0D0H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits140:
 Mov ItemSection, 0E0H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits150:
 Mov ItemSection, 0F0H
 Xor Eax, Eax
 Mov Eax, 1
CalculateItemIDEnd:
 Pop Edi
 Pop Esi
 Pop Ebx
 Mov Esp, Ebp
 Pop Ebp
 Ret
CalculateItemID EndP

Well this fuction is a reeplase of the current call:

Code:
00434AB8    E8 67F6FCFF     CALL GameServ.00404124

Most knowed has the item byte converter, wich is used alot of times for take the itembyte, but i will set a example:

Code:
C2 00 0E 31 00 01 00 [06] 00 28 00 24 30 00 //1.02 ->Halberd
C2 00 0C 31 00 01 00 [66] 00 FF 00 00 //1.0h ->Halberd

well you can check there the difference between 1.02 and 1.0h, what change is the itemID wich is under [] and 2 new bits, one when its holded the section wich belongs to that item, and the last byte wich is for new items.

what this fuction make is convert the 1.0h value wich on example is 66 and return on ECX regist 06 (value used for 1.02), on EAX will be returned if the instruction was sucefull completed with the value 1 (1 = correct, 0 = wrong). The fuction present also a empty space wich is defined on -data and .const
section wich is for hold the itemID and the itemSection, so you can easy later can use that empty space for you new packets. (GS to client)

the source has been compiled on a DLL, and its tested also works fully, this is only a little help to coders than want to mod the item protocol for any new client and hope you guys can make it fast :juggle:.

Wish best luck to my brothers of real coding, FeN$x.

Ciao :eek:
 
Last edited:
I'll take you all on.
Loyal Member
Joined
May 11, 2004
Messages
3,253
Reaction score
6
(response to flame removed - DaRcAntiX)


i love you Fen$x, keep up the good work

my coder idol
 
Last edited by a moderator:
Initiate Mage
Joined
Mar 8, 2006
Messages
0
Reaction score
0
(Removed non-english content, possible response to flame - DaRcAntiX)


Have a nice day boyzz :)
 
Last edited by a moderator:
Newbie Spellweaver
Joined
Oct 18, 2005
Messages
23
Reaction score
0
Nja sarun valodina teu laba!!

[ENG]

Nice work FeN$x you are the best
 
Experienced Elementalist
Joined
Aug 21, 2006
Messages
213
Reaction score
1
hmm the code seems real god quality this time. TY again man.
 
Newbie Spellweaver
Joined
Sep 26, 2005
Messages
11
Reaction score
0
Bla atkal kaut kadu sudu uzkodejis ;D

Very nice work man ;D
 
Newbie Spellweaver
Joined
Sep 5, 2005
Messages
81
Reaction score
0
Well hi to all coders, i had been hear than some teams got freaking troubles on understand how new protocol for items works for new clients, so i develop some weeks ago this fuction for reeplase some old one in GS and it will help alot to coders on change the protocol to new clients, so here i left it:

Code:
.Const
ITEMSECTIONSPACE Equ 40H
ITEMINDEXSPACE Equ 40H

.Data
ItemSection DB ITEMSECTIONSPACE Dup(0)
GlobalItemIndex DB ITEMINDEXSPACE Dup(0)

CalculateItemID Proc
Local CMyItemID:DWord
Local CMyItemIndex:DWord
 Push Ebx
 Push Esi
 Push Edi
 Mov Ecx, DWord Ptr Ss:[Ebp + 8H]
 Mov CMyItemID, Ecx
 Xor Eax, Eax
 Mov Eax, 1
 Cmp Ecx, 0
 Je CalculateItemIDEnd
 Xor Eax, Eax
CSubNumbers:
 Add Eax, 1
 Sub Ecx, 10H
 Cmp Ecx, 0
 Je CMoveItemID
 Cmp Ecx, 0FFFFFFFFH
 Jle CMoveItemID
 Jmp CSubNumbers
CMoveItemID:
 Mov Ecx, CMyItemID
 Cmp Ecx, 1FH
 Jle CDecreaseBytebyone
 Cmp Ecx, 21H
 Jge CCheckAll
 Jmp CCalculateItemSection
CCheckAll:
 Cmp Ecx, 20H
 Je CCalculateItemSection
 Cmp Ecx, 40H
 Je CCalculateItemSection
 Cmp Ecx, 60H
 Je CCalculateItemSection
 Cmp Ecx, 80H
 Je CCalculateItemSection
 Cmp Ecx, 0A0H
 Je CCalculateItemSection
 Cmp Ecx, 0C0H
 Je CCalculateItemSection
 Cmp Ecx, 0E0H
 Je CCalculateItemSection
 Cmp Ecx, 100H
 Je CCalculateItemSection
 Cmp Ecx, 120H
 Je CCalculateItemSection
 Cmp Ecx, 140H
 Je CCalculateItemSection
 Cmp Ecx, 160H
 Je CCalculateItemSection
 Cmp Ecx, 180H
 Je CCalculateItemSection
 Cmp Ecx, 1A0H
 Je CCalculateItemSection
 Cmp Ecx, 1C0H
 Je CCalculateItemSection
 Cmp Ecx, 1E0H
 Je CCalculateItemSection
CDecreaseBytebyone:
 Sub Eax, 1
CCalculateItemSection:
 IMul Eax, Eax, 10H
 Mov CMyItemIndex, Eax
 Mov Ecx, CMyItemID
 Sub Ecx, Eax
 Mov DWord Ptr GlobalItemIndex, Ecx
CheckByteSection:
 Mov Eax, CMyItemIndex
 Cmp Eax, 10H
 Je Cits0
 Cmp Eax, 20H
 Je Cits10
 Cmp Eax, 40H
 Je Cits20
 Cmp Eax, 60H
 Je Cits30
 Cmp Eax, 80H
 Je Cits40
 Cmp Eax, 0A0H
 Je Cits50
 Cmp Eax, 0C0H
 Je Cits60
 Cmp Eax, 0E0H
 Je Cits70
 Cmp Eax, 100H
 Je Cits80
 Cmp Eax, 120H
 Je Cits90
 Cmp Eax, 140H
 Je Cits100
 Cmp Eax, 160H
 Je Cits110
 Cmp Eax, 180H
 Je Cits120
 Cmp Eax, 1A0H
 Je Cits130
 Cmp Eax, 1C0H
 Je Cits140
 Cmp Eax, 1E0H
 Je Cits150
 Xor Eax, Eax
 Jmp CalculateItemIDEnd
Cits0:
 Mov ItemSection, 0
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits10:
 Mov ItemSection, 10H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits20:
 Mov ItemSection, 20H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits30:
 Mov ItemSection, 30H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits40:
 Mov ItemSection, 40H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits50:
 Mov ItemSection, 50H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits60:
 Mov ItemSection, 60H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits70:
 Mov ItemSection, 70H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits80:
 Mov ItemSection, 80H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits90:
 Mov ItemSection, 90H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits100:
 Mov ItemSection, 0A0H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits110:
 Mov ItemSection, 0B0H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits120:
 Mov ItemSection, 0C0H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits130:
 Mov ItemSection, 0D0H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits140:
 Mov ItemSection, 0E0H
 Xor Eax, Eax
 Mov Eax, 1
 Jmp CalculateItemIDEnd
Cits150:
 Mov ItemSection, 0F0H
 Xor Eax, Eax
 Mov Eax, 1
CalculateItemIDEnd:
 Pop Edi
 Pop Esi
 Pop Ebx
 Mov Esp, Ebp
 Pop Ebp
 Ret
CalculateItemID EndP

Well this fuction is a reeplase of the current call:

Code:
00434AB8    E8 67F6FCFF     CALL GameServ.00404124

Most knowed has the item byte converter, wich is used alot of times for take the itembyte, but i will set a example:

Code:
C2 00 0E 31 00 01 00 [06] 00 28 00 24 30 00 //1.02 ->Halberd
C2 00 0C 31 00 01 00 [66] 00 FF 00 00 //1.0h ->Halberd

well you can check there the difference between 1.02 and 1.0h, what change is the itemID wich is under [] and 2 new bits, one when its holded the section wich belongs to that item, and the last byte wich is for new items.

what this fuction make is convert the 1.0h value wich on example is 66 and return on ECX regist 06 (value used for 1.02), on EAX will be returned if the instruction was sucefull completed with the value 1 (1 = correct, 0 = wrong). The fuction present also a empty space wich is defined on -data and .const
section wich is for hold the itemID and the itemSection, so you can easy later can use that empty space for you new packets. (GS to client)

the source has been compiled on a DLL, and its tested also works fully, this is only a little help to coders than want to mod the item protocol for any new client and hope you guys can make it fast :juggle:.

Wish best luck to my brothers of real coding, FeN$x.

Ciao :eek:

Thanks FeN$x For Your Knowledge Sharing...
 
Experienced Elementalist
Joined
Jul 4, 2006
Messages
226
Reaction score
0
"if you dont like FeN$x, you dont like muonline"
Thanks FeN$x For Your Knowledge Sharing
 
Newbie Spellweaver
Joined
Sep 25, 2005
Messages
78
Reaction score
1
Well thx all, about the fuction i can say its 100% working and the sintax i use for get the 1.02 itemID with the section should work for all the rest of fuctions you just need to mod the code and add it to your DLL, later reeplase it for the call on GS and you will get real ID for 1.02 and even season2 client in ECX regist. :technolog

Thx again and soon i will released some other sources, cya.
 
Newbie Spellweaver
Joined
Jul 1, 2005
Messages
77
Reaction score
0
Thanks FeN$x


EDIT: Where is the offset to change the map protocol?

And don't you change it to Push E9 ?
 
Last edited:
Newbie Spellweaver
Joined
Feb 14, 2006
Messages
5
Reaction score
0
Well this code is at a very average level!
I have try to make a request to my library from GS that caused a buffer owerflow and it duck*d all the computer.
 
Newbie Spellweaver
Joined
Sep 25, 2005
Messages
78
Reaction score
1
Well this code is at a very average level!
I have try to make a request to my library from GS that caused a buffer owerflow and it duck*d all the computer.

i dont what means average level but if the code give you some problem its caused you dont reeplase well the call of byteitemconvert...

the code is tested and its code on that way caused you need to hook arguments to it, i try alot of ways to make it but this was the most short and fast i made and finally its impossible this code give you a overflow caused it got triggers for any value than could caused overflow:

Code:
 Cmp Ecx, 0
 Je CMoveItemID
 Cmp Ecx, 0FFFFFFFFH

Any trouble of code is due the reeplase of call in GS... :wink2:
 
Newbie Spellweaver
Joined
Sep 25, 2005
Messages
78
Reaction score
1
Thanks FeN$x


EDIT: Where is the offset to change the map protocol?

And don't you change it to Push E9 ?

this is item protocol, please read well and its a very short part of custom fuction for return season2 item values and itemID section for use it on packets.

nothing to do with map protocol, the map protocol are triggers and no more...
 
Newbie Spellweaver
Joined
Aug 14, 2005
Messages
93
Reaction score
121
FeN$x I'm trying to create a dll but i don't know if my work is good, im a noob in ASM, could you help me if the code is correct (builded in Masm v9
 

Attachments

You must be registered for see attachments list
Newbie Spellweaver
Joined
Jul 1, 2005
Messages
77
Reaction score
0
I know this has nothing to do with the map protocol...

I was just asking where the map protocol is located inside the GS. But nevermind, I found a guide you posted on CZF Forums.
 
Last edited:
Back
Top